|
|
@ -1,10 +1,12 @@ |
|
|
|
## Palindrome |
|
|
|
## AlmostPalindrome |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
|
|
In a file named `AlmostPalindrome.java` write a function `isAlmostPalindrome` that returns true if the String in parameter is almost palindrome. |
|
|
|
In a file named `AlmostPalindrome.java` write a function `isAlmostPalindrome` that returns true if the String in parameter is almost palindrome. |
|
|
|
A word is considered "almost a palindrome" if removing one letter from the word makes it a palindrome. |
|
|
|
A word is considered "almost a palindrome" if removing one letter from the word makes it a palindrome. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
> đź’ˇ The String in parametre will contains at least 3 letters. |
|
|
|
|
|
|
|
|
|
|
|
### Expected Functions |
|
|
|
### Expected Functions |
|
|
|
|
|
|
|
|
|
|
|
```java |
|
|
|
```java |
|
|
@ -22,7 +24,7 @@ Here is a possible `ExerciseRunner.java` to test your function : |
|
|
|
```java |
|
|
|
```java |
|
|
|
public class ExerciseRunner { |
|
|
|
public class ExerciseRunner { |
|
|
|
public static void main(String[] args) { |
|
|
|
public static void main(String[] args) { |
|
|
|
System.out.println(AlmostPalindrome.isAlmostPalindrome("reviver")); |
|
|
|
System.out.println(AlmostPalindrome.isAlmostPalindrome("Racedcar")); |
|
|
|
System.out.println(AlmostPalindrome.isAlmostPalindrome("level")); |
|
|
|
System.out.println(AlmostPalindrome.isAlmostPalindrome("level")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|