Could someone explain me why my code doesn't pass the tests of sololearn ??? How should I build my solutions ?
import java.util.List; import java.util.ArrayList; public class Program { public static void main(String[] args) { descryptor ("s@ocat@@"); } public static void descryptor (String input){ char [] arrInp =input.toCharArray(); List <Character> box=new ArrayList <>(); int len=arrInp.length-1 ; int count =0; for(int k=len;k>=0;k--){ if(Character.isLetter(arrInp [k])|| arrInp[k]==' '){ box.add(arrInp[k]); count ++; } } char[] dest=new char[box.size()]; for(int i=0;i<dest.length; i++){ dest[i]=box.get(i); } String out=new String(dest); System .out .println (out); } }