+ 1
I'm trying to solve a reverse string question but my code is not being accepted by Sololearn? My code is in the description sect
import java.util.Scanner; import java.util.*; public class Program { public static void main(String[] args) { Scanner abx = new Scanner(System.in); String text = abx.nextLine(); char[] arr = text.toCharArray(); //your code goes here int a=arr.lenght-1; for(int j=a;j>=0;j--){ System.out.print(arr[j]); } } }
2 Answers
+ 4
typo with "length" spelling
+ 2
Thanks mate