You are viewing a single comment's thread. Return to all comments →
boolean isPalindrome = true;
for (int i = 0; i < A.length() / 2; i++) { if (A.charAt(i) != A.charAt(A.length() - 1 - i)) { isPalindrome = false; break; } } if (isPalindrome) { System.out.println("Yes"); } else { System.out.println("No"); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java String Reverse
You are viewing a single comment's thread. Return to all comments →
boolean isPalindrome = true;