C++ code using DFS/Backtracking
Try out all possible strings that can be formed and return the minimum of them. \nHave a map so to break the recursion if we encounter the same string (because 
Try out all possible strings that can be formed and return the minimum of them. \nHave a map so to break the recursion if we encounter the same string (because it will be leading to the same possibilities). \nNotice the rotate function, visualise it. It\'s a real treat!.\nThank You\n```\nclass Solution {\npublic:\n    #define min(a,b) (a>b?b:a)\n    string ans;\n    unordered_map<string,bool> visited;\n    string add(string s, int &a){\n        for(int i=1;i<s.size();i+=2){\n            int x = s[i]-\'0\';\n            x = (x+a)%10;\n            s[i]  = (char)(x+\'0\');\n        }\n        return s;\n    }\n    string rotate(string s, int &b){\n        reverse(s.begin(),s.end());\n        reverse(s.begin(),s.begin()+b);\n        reverse(s.begin()+b,s.end());\n        return s;\n    }\n    void dfs(string s, int &a, int &b){\n        if(visited[s]) return;\n        visited[s] =1;\n        ans=min(ans,s);\n        dfs(rotate(s,b),a,b);\n        dfs(add(s,a),a,b);\n    }\n    string findLexSmallestString(string s, int a, int b) {\n        ans = s;\n        dfs(s,a,b);\n        return ans;\n    }\n};\n\n```
['Recursion', 'C']