Beats 100%🔥|| easy JAVA Solution✅
Code\n\nclass Solution {\n    public String getSmallestString(String s, int k) {\n        char arr[]=s.toCharArray();\n        for(int i=0;i<arr.length;i++){\n 
# Code\n```\nclass Solution {\n    public String getSmallestString(String s, int k) {\n        char arr[]=s.toCharArray();\n        for(int i=0;i<arr.length;i++){\n            Pair x=sol(arr[i],k);\n            arr[i]=x.ch;\n            k-=x.val;\n            if(k==0) break;\n        }\n        return new String(arr);\n    }\n    public Pair sol(char ch,int k){\n        for(char i=\'a\';i<=\'z\';i++){\n            int a=Math.abs(ch-i);\n            int b=Math.abs(i-ch+26);\n            if(a<=k || b<=k){\n                return new Pair(Math.min(a,b),i);\n            }\n        }\n        return new Pair(1000000,\'n\');\n    }\n}\nclass Pair{\n    int val;\n    char ch;\n    Pair(int val,char ch){\n        this.val=val;\n        this.ch=ch;\n    }\n}\n```
['Java']