Java Backtrack, Easy to understand
\nclass Solution {\n    char[] min;\n    public String findLexSmallestString(String s, int a, int b) {\n        if (s == null || s.length() == 0) {\n           
```\nclass Solution {\n    char[] min;\n    public String findLexSmallestString(String s, int a, int b) {\n        if (s == null || s.length() == 0) {\n            return s;\n        }\n        int length = s.length();\n        min = new char[length];\n        Arrays.fill(min, \'9\');\n        b = b % length;\n        helper(s.toCharArray(), a, b, new HashSet<>());\n        return new String(min);\n    }\n    private void helper(char[] array, int a, int b, Set<String> set) {\n        if (!set.add(new String(array))) {\n            return;\n        }\n        // compare\n        if (smaller(array, min) && allDigit(array)) {\n            min = Arrays.copyOf(array, array.length);\n        }\n        // rotate\n        char[] copy = Arrays.copyOf(array, array.length);\n        rotate(array, 0, array.length - b - 1);\n        rotate(array, array.length - b, array.length - 1);\n        rotate(array, 0, array.length - 1);\n        helper(array, a, b, set);\n        array = Arrays.copyOf(copy, copy.length);\n        \n        // add\n        add(array, a);\n        helper(array, a, b, set);\n        array = Arrays.copyOf(copy, copy.length);\n    }\n    private boolean smaller(char[] array1, char[] array2) {\n        for (int i = 0; i < array1.length; i++) {\n            if (array1[i] == array2[i]) {\n                continue;\n            } else if (array1[i] < array2[i]) {\n                return true;\n            } else {\n                return false;\n            }\n        }\n        \n        return false;\n    }\n    boolean allDigit(char[] array) {\n        for (char c : array) {\n            if (!Character.isDigit(c)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    private void add(char[] array, int a) {\n        boolean found = false;\n        if (array[0] == \'7\' && array[1] == \'9\') {\n            found = true;\n        }\n\n        for (int i = 1; i < array.length; i += 2) {\n            int temp = array[i] - \'0\';\n            temp = (temp + a) % 10;\n            array[i] = (char)(\'0\' + temp);\n        }\n\n    }\n    private void rotate(char[] array, int start, int end) {\n        while (start < end) {\n            char c = array[start];\n            array[start] = array[end];\n            array[end] = c;\n            start++;\n            end--;\n        }\n    }\n}\n```
[]