loading...

re: Reverse a Word. VIEW POST

FULL DISCUSSION
 

why not just this
public static boolean isPalindrome(String str) {
return str.equals(new StringBuilder(str).reverse().toString());
}

 

You are using Java's in built reverse method. Normally in an interview, you create your own algorithm i.e. your own implementation of reverse method.

 

Oh OK these post are like examples for juniors when doing interview and stuff

Code of Conduct Report abuse