JAVA - Easy to Understand Concise Beginner BFS
\nclass Solution {\n    public String findLexSmallestString(String s, int a, int b) {\n        Map<String, Boolean> map = new TreeMap<String, Boolean>();\n     
```\nclass Solution {\n    public String findLexSmallestString(String s, int a, int b) {\n        Map<String, Boolean> map = new TreeMap<String, Boolean>();\n        int n=s.length();\n        Queue<String> q = new LinkedList<String>();\n        q.add(s);\n        \n        while(!q.isEmpty()){\n            String front = q.poll();\n        \n            if(!map.containsKey(front)){\n                 map.put(front, true);\n                 q.add(front);\n            }\n               \n            \n            //op-a\n            StringBuilder sb = new StringBuilder();\n            for(int i=0;i<n;++i){\n                if(i%2==1){\n                    sb.append((front.charAt(i)-\'0\'+a)%10);\n                } else \n                    sb.append(front.charAt(i));\n            }\n            String curr = sb.toString();\n            \n            if(!map.containsKey(curr)){\n                map.put(curr, true);\n                q.add(curr);\n            }\n            \n            //op-b\n            sb.setLength(0);\n            for(int i=n-b;i<n;++i){\n                    sb.append(front.charAt(i));\n            }\n            for(int i=0;i<n-b;++i){\n                    sb.append(front.charAt(i));\n            }\n            curr = sb.toString();\n\n            if(!map.containsKey(curr)){\n                map.put(curr, true);\n                q.add(curr);\n            }\n            \n            \n            \n        }\n        \n        return map.entrySet().stream().findFirst().get().getKey();\n        \n    }\n}\n```
[]