Best Java Solution || Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n\n/*\n    static String helper(int n, int k){\n        StringBuilder s = new StringBuilder();\n        s.append("a".repeat(n));\n        if(n==k) return s.toString();\n\n        k=k-n;\n        for(int i=0; i<n; i++){\n            if(k>=25){\n                s.replace(i,i+1,"z");\n                k=k-25;\n                if(k==0) break;\n            }\n            else{\n                char ch = (char)(k+97);\n                s.replace(i,i+1,ch+"");\n                break;\n            }\n        }\n\n        return s.reverse().toString();\n    }\n    */\n    public String getSmallestString(int n, int k) {\n        char arr[] = new char[n];\n        Arrays.fill(arr,\'a\');\n\n        k=k-n;\n\n        while(k>0){\n            n--;\n            arr[n] += Math.min(25,k);\n            k = k-Math.min(25,k);\n        }\n\n        return String.valueOf(arr);\n    }\n}\n```
['Java']