DFS. Simple and clear solution
\nclass Solution:\n    def findLexSmallestString(self, s: str, a: int, b: int) -> str:\n\n        def dfs(s):\n            if s in used:\n                return
```\nclass Solution:\n    def findLexSmallestString(self, s: str, a: int, b: int) -> str:\n\n        def dfs(s):\n            if s in used:\n                return s\n            used.add(s)\n            s1 = \'\'.join(ch1 + dic[ch2] for ch1, ch2 in zip(*[iter(s)]*2))\n            s2 = s[b:] + s[:b]\n            return min(s1, s2, dfs(s1), dfs(s2))\n\n        dic = {ch : str((int(ch) + a) % 10) for ch in digits}\n        used = set()\n        return dfs(s)    \n```
['Depth-First Search', 'Python3']