simple


  • -1
    A

    '''
    boolean isPaliondrome = false;
    int tailleX = String.valueOf(x).length();
    String xx = String.valueOf(x);
    int j =0;
    if(x>0){
    for(int i=1; i<= tailleX/2; i++) {

            if(xx.substring(j,i).equals(xx.substring(tailleX - i, tailleX - j))){
                isPaliondrome = true;
            } else {
                isPaliondrome = false;
                break;
            }
            j=i;
        }
        }
        
        if(tailleX==1){
           isPaliondrome = true; 
        }
        return isPaliondrome;  
    }
    

    }
    '''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.