Easy C++ BFS Solution
\nclass Solution {\npublic:\n    string findLexSmallestString(string s, int a, int b) {\n        string ans = s;\n        int len = s.size();\n        queue<str
```\nclass Solution {\npublic:\n    string findLexSmallestString(string s, int a, int b) {\n        string ans = s;\n        int len = s.size();\n        queue<string> q;\n        q.push(s);\n        set<string> vis;\n        while(!q.empty())\n        {\n            int n = q.size();\n            for(int i = 0; i < n; i++)\n            {\n                string t = q.front();\n                ans = min(ans, t);\n                q.pop();\n                \n                if(vis.count(t))\n                    continue;\n                vis.insert(t);\n                \n                // 1st operation\n                string tt = t;\n                for(int j = 0; j < len; j++)\n                {\n                    if(j & 1)\n                    {\n                        int num = ((tt[j] - \'0\') + a) % 10;\n                        tt[j] = (num + \'0\');\n                    }\n                }\n                q.push(tt);\n                \n                // 2nd operation\n                tt = t;\n                for(int j = 0; j < b; j++)\n                {\n                    char c = tt.back();\n                    tt.pop_back();\n                    tt = c + tt;\n                }\n                q.push(tt);\n            }\n        }\n        return ans;\n    }\n};\n```
['Tree', 'Breadth-First Search']