Why do i get a failed test when i run it print ture
Write the method isPalindrome that takes in a String as a parameter and returns true if it is a Palindrome and false if it is not a Palindrome. Spaces and capitalization do not matter. isPalindrome("Bob") ------> True isPalindrome("Taco Cat") ------> True isPalindrome("small Dragon") ------> False isPalindrome("Never Odd or even") ------> True isPalindrome("Turkey") ------> False class Main { public static void main(String[] args) { System.out.println(isPalindrome("Bob")); // you can add more test cases here } public static boolean isPalindrome(String word) { int left = 0, right = word.length() - 1; while(left < right) { if(word.charAt(left) != word.charAt(right)) { return true; } left++; right--; } return false; //write code here } } What can I improve to make sure it passes the test.