Easy BFS approach in C++
\nclass Solution \n{\npublic:\n    string add(string s,int a)\n    {\n        for(int i=1;i<s.length();i+=2)\n        {\n            s[i]=(((s[i]-\'0\')+a)%10)+
```\nclass Solution \n{\npublic:\n    string add(string s,int a)\n    {\n        for(int i=1;i<s.length();i+=2)\n        {\n            s[i]=(((s[i]-\'0\')+a)%10)+\'0\';\n        }\n        return s;\n    }\n    string rotate(string s,int b)\n    {\n        string aux=s;\n        for(int i=0;i<s.length();i++)\n        {\n            s[(i+b)%s.length()]=aux[i];\n        }\n        return s;\n    }\n    string findLexSmallestString(string s, int a, int b)\n    {\n        queue<string>q;\n        q.push(s);\n        unordered_set<string>st;\n        st.insert(s);\n        string ans=s;\n        while(!q.empty())\n        {\n            string node=q.front();\n            q.pop();\n            ans=min(ans,node);\n            string added=add(node,a);\n            string rotated=rotate(node,b);\n            if(st.find(added)==st.end())\n            {\n                st.insert(added);\n                q.push(added);\n            }\n            if(st.find(rotated)==st.end())\n            {\n                st.insert(rotated);\n                q.push(rotated);\n            }\n        }\n        return ans;\n    }\n};\n```
['Breadth-First Search', 'C']