Clearer solution


  • 0
    Q
    public class Solution {
        public String convertToTitle(int n) {
            String title = "";
            while (n > 0) {
                title = (char)((int)'A' + (n - 1) % 26) + title;
                n = (n - 1) / 26;
            }
            return title;
        }
    }
    

    // Without checking discussion


  • 0

    Clearer than what?


Log in to reply
 

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