Java : DFS [beats 100 % in at least half the submissions] and BFS [beats 33 %]
DFS -\n\nclass Solution {\n    public String findLexSmallestString(String s, int a, int b) {\n        Set<String> seen = new HashSet<>();\n        seen.add(s);\
DFS -\n```\nclass Solution {\n    public String findLexSmallestString(String s, int a, int b) {\n        Set<String> seen = new HashSet<>();\n        seen.add(s);\n        \n        return dfs(s, a, b, seen);\n    }\n    \n    private String dfs(String s, int a, int b, Set<String> seen) {\n        String ans = s;\n        String s1 = op1(s, a);\n        if (!seen.contains(s1)) {\n            seen.add(s1);\n            s1 = dfs(s1, a, b, seen);\n            if (ans.compareTo(s1) > 0) {\n                ans = s1;\n            }\n        }\n        \n        s1 = op2(s, b);\n        if (!seen.contains(s1)) {\n            seen.add(s1);\n            s1 = dfs(s1, a, b, seen);\n            if (ans.compareTo(s1) > 0) {\n                ans = s1;\n            }\n        }\n        \n        return ans;\n    }\n    \n    private String op1(String s, int a) {\n        StringBuilder sb = new StringBuilder();\n        int i = 0;\n        while(i < s.length()) {\n            if (i%2 == 0) {\n                sb.append(s.charAt(i));\n                i++;\n                continue;\n            }\n            int ch = (s.charAt(i)-\'0\')+a;\n            ch = ch%10;\n            sb.append(""+ch);\n            i++;\n        }\n        \n        return sb.toString();\n    }\n    \n    private String op2(String s, int b) {\n        String s1 = reverse(s.substring(0, b));\n        String s2 = reverse(s.substring(b));\n        StringBuilder sb = new StringBuilder(s1+s2);\n        \n        return sb.reverse().toString();\n    }\n    \n    private String reverse(String s) {\n        StringBuilder sb = new StringBuilder(s);\n        return sb.reverse().toString();\n    }\n}\n```\n\nBFS -\n```\nclass Solution {\n    public String findLexSmallestString(String s, int a, int b) {\n        Set<String> seen = new HashSet<>();\n        seen.add(s);\n        \n        String ans = s;\n        Queue<String> q = new LinkedList<>();\n        q.add(s);\n        while(!q.isEmpty()) {\n            String next = q.remove();\n            \n            String s1 = op1(next, a);\n            if (!seen.contains(s1)) {\n                if (ans.compareTo(s1) > 0) {\n                    ans = s1;\n                }\n                q.add(s1);\n                seen.add(s1);\n            }\n            \n            s1 = op2(next, b);\n            if (!seen.contains(s1)) {\n                if (ans.compareTo(s1) > 0) {\n                    ans = s1;\n                }\n                q.add(s1);\n                seen.add(s1);\n            }\n        }\n        \n        return ans;\n    }\n    \n    private String op1(String s, int a) {\n        StringBuilder sb = new StringBuilder();\n        int i = 0;\n        while(i < s.length()) {\n            if (i%2 == 0) {\n                sb.append(s.charAt(i));\n                i++;\n                continue;\n            }\n            int ch = (s.charAt(i)-\'0\')+a;\n            ch = ch%10;\n            sb.append(""+ch);\n            i++;\n        }\n        \n        return sb.toString();\n    }\n    \n    private String op2(String s, int b) {\n        String s1 = reverse(s.substring(0, b));\n        String s2 = reverse(s.substring(b));\n        StringBuilder sb = new StringBuilder(s1+s2);\n        \n        return sb.reverse().toString();\n    }\n    \n    private String reverse(String s) {\n        StringBuilder sb = new StringBuilder(s);\n        return sb.reverse().toString();\n    }\n}\n```
[]