Java | String builder Simple solution
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    public String getSmallestString(String s, int k) {\n        StringBuilder sb = new StringBuilder();\n        for(int i=0; i<s.length(); i++) {\n            int adist = s.charAt(i)-\'a\';\n            int zdist = \'z\' - s.charAt(i) + 1;\n            int mindist = Math.min(adist,zdist);\n            if(k>=mindist) {\n                k-=mindist;\n                sb.append(\'a\');\n            } else {\n                if(k>0) {\n                    sb.append((char)(s.charAt(i)-k));\n                    k=0;\n                }  else {\n                    sb.append(s.charAt(i));\n                }\n                \n            }\n\n        }\n        return sb.toString();\n    }\n}\n```
['Java']