You are viewing a single comment's thread. Return to all comments →
works fine
import java.io.; import java.util.;
public class Solution {
public static String palindrome(String A){ char[] char_array = A.toCharArray(); int i = 0; int j = A.length()-1; while(i<j){ if(char_array[i]!=char_array[j]){ return "No"; } i++; j--; } return "Yes"; } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String A = scanner.next(); System.out.println(palindrome(A));
} }
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 →
works fine
import java.io.; import java.util.;
public class Solution {
} }