If you want to reverse a String
why are you adding it to a list ?
Use this :
String s = sc.next(); StringBuilder sb = new StringBuilder(s); System.out.println(sb.reverse());
If you want to reverse a String
why are you adding it to a list ?
Use this :
String s = sc.next(); StringBuilder sb = new StringBuilder(s); System.out.println(sb.reverse());