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 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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]); } } }

17th Jul 2021, 8:01 AM
Paridzaishe Foto
Paridzaishe Foto - avatar
2 Answers
+ 4
typo with "length" spelling
17th Jul 2021, 8:03 AM
Rohit
+ 2
Thanks mate
17th Jul 2021, 8:09 AM
Paridzaishe Foto
Paridzaishe Foto - avatar