I am Really Tired of These Kind of Questions, Can Anyone Take a Look Where it goes Wrong?
Is there any fancy algorithm? What the hell of this question. BEEP.\n\n    public String findLexSmallestString(String s, int a, int b) {\n        char[] ch = s.
Is there any fancy algorithm? What the hell of this question. BEEP.\n```\n    public String findLexSmallestString(String s, int a, int b) {\n        char[] ch = s.toCharArray();\n        while (true) {\n            char[] c1 = rotate(ch, b);\n            char[] c2 = add(ch, a);\n            if (lessThan(c1, ch)) {\n                for (int i=0; i<ch.length; i++) {\n                    ch[i] = c1[i];\n                    \n                }                                     \n            } \n            else if (lessThan(c2, ch)) {\n                for (int i=0; i<ch.length; i++) {\n                    ch[i] = c2[i];\n                }\n            }\n                               \n\n            else if (!lessThan(c1, ch) && !lessThan(c2, ch)) break;\n        }  \n        return String.valueOf(ch);\n\n    }\n    \n    public char[] rotate(char[] ch, int b) {\n        reverse(ch, 0, b-1);\n        reverse(ch, b, ch.length - 1);\n        reverse(ch, 0, ch.length - 1);\n        \n        char[] res =  new char[ch.length];\n        for (int i=0; i<ch.length; i++) {\n            res[i] = ch[i];\n        }\n        System.out.println(String.valueOf(res));\n        return res;\n    }\n    \n    public char[] add(char[] ch, int a) {\n        for (int i= 0; i<ch.length; i++) {\n            if (i % 2 != 0) {\n                int temp = ch[i] - \'0\' + a;\n                //System.out.println(temp);\n                if (temp > 9) temp -= 10;\n                ch[i] = (char)(temp + \'0\');\n            }\n        }\n        //System.out.println(String.valueOf(ch));\n        char[] res =  new char[ch.length];\n        for (int i=0; i<ch.length; i++) {\n            res[i] = ch[i];\n        }\n        return res;\n    }\n    \n    public void reverse(char[] ch, int s, int e) {\n        while (s < e) {\n            char temp = ch[s];\n            ch[s] = ch[e];\n            ch[e] = temp;\n            s++;\n            e--;\n        }\n    }\n    \n    public boolean lessThan(char[] c1, char[] c2) {\n        for (int i=0; i<c1.length; i++) {\n            if (c1[i] - c2[i] < 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n```
[]