Meta Interview Question

Write a function to determine if a string is a palindrome

Interview Answer

Anonymous

Oct 13, 2015

public boolean isPalindrome(String str) { int length = str.length(); for (int x = 0; x < length / 2; x++) { if (str.charAt(x) != str.charAt(length - 1 - x)) return false; } return true; }

1