Remove 9


  • 0

    Click here to see the full article post


  • 0
    D

    public class Base9 {

    public static int convertToBase9(int x)
    {
     if(x%10 == 9)
    	return x+1;
    else 
    		return x;
    }
    public static void main(String[] args) {
    

    for(int i = 0; i<100;++i)
    System.out.println(Base9.convertToBase9(i));
    }

    }


Log in to reply
 

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