please write an editorial for PALIN problem.
@fahadmunir32
but this will never work in this question…as the constraints are very large…and u can not check every number using this.first read this question…“PALIN”.
My code is not working properly:
import java.util.*;
class Main
{
public static boolean palin(long a){
long right=a;
long rev=0;
while(a>=10){
rev=rev*10+a%10;
a=a/10;
}
if(rev==right)
return true;
else
return false;
}
public static void main (String[] args) throws java.lang.Exception
{
Scanner scan=new Scanner(System.in);
int turn=scan.nextInt();
for(int i=0;i<turn;i++){
long num=scan.nextLong();
while(palin(++num)!=true){
}
System.out.println(num);
}
}
}
Please send suggestion to
[email protected]