Recursive one line java solution


  • 0
    C
    public class Solution {
         public String convertToTitle(int n) {
           return n <= 26 ? "" + (char)(64+n) : convertToTitle(--n/26).concat(""+(char)(n%26 +65));
      }
    }

Log in to reply
 

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