My Simple bfs solution
\nclass Solution {\npublic:\n    string add(string s, int a)\n    {\n        for(int i=1;i<s.size();i=i+2)\n        {\n           int x = s[i]-\'0\';\n         
```\nclass Solution {\npublic:\n    string add(string s, int a)\n    {\n        for(int i=1;i<s.size();i=i+2)\n        {\n           int x = s[i]-\'0\';\n            x=x+a;\n            x=x%10;\n            char y = \'0\'+x;\n            s[i]=y;\n        }\n        return s;\n    }\n    string rotate(string s, int b)\n    {\n        for(int i=0;i<b;i++)\n        {\n            char p = s[s.length()-1];\n                s.pop_back();\n            s.insert(s.begin(), p); \n            \n        }\n        return s;\n    }\n    string findLexSmallestString(string s, int a, int b) {\n        unordered_map<string,bool> visited;\n        queue<string> q;\n        q.push(s);\n        string m = s ;\n        visited[s] =1 ;\n        while(!q.empty()){\n             string front = q.front();\n             q.pop();\n             m=min(m,front);\n            string addstr = add(front,a) , rotatestr = rotate(front,b) ;\n             if(visited[addstr]==0) { visited[addstr]=1  ; q.push(addstr);}\n             if(visited[rotatestr]==0){visited[rotatestr]=1  ; q.push(rotatestr);}\n        }\n        return m;\n        \n    }\n};\n```
[]