You are viewing a single comment's thread. Return to all comments →
It passed all test cases
public static void main(String[] args) { Scanner sc=new Scanner(System.in); String A=sc.next(); int i = 0, j=A.length()-1; while(A.charAt(i)==A.charAt(j) && i++<j--); System.out.print(i>j?"Yes":"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 →
It passed all test cases