Python BFS w/ comment
py\n\'\'\'\nw: BFS\nh: for each possible number (node), we have two possible operations (add, rotate)\n    it seems to be a 2^100 possible number, however, note
```py\n\'\'\'\nw: BFS\nh: for each possible number (node), we have two possible operations (add, rotate)\n    it seems to be a 2^100 possible number, however, note:\n    1) add a to number of odd index, we will get to the same number after 10 rounds of add\n    2) s has even length, if b is odd, we can get the same number after n round\n    3) for each shift, we would get different number at even index in 10 rounds\n    \n    so we would have 10 * n * 10 number at most, then we can use BFS + memo\n\'\'\'\nimport collections\n\nclass Solution:\n    def findLexSmallestString(self, s: str, a: int, b: int) -> str:\n        seen = set()\n        deque = collections.deque([s])\n\n        while deque:\n            #print(deque)\n            curr = deque.popleft()\n            seen.add(curr)\n            \n            #1.add\n            ad = self.add_(curr, a)\n            if ad not in seen:\n                deque.append(ad)\n                seen.add(ad)\n\n            \n            #2. rotate:\n            ro = self.rotate_(curr, b)\n            if ro not in seen:\n                deque.append(ro)\n                seen.add(ro)\n\n        return min(seen)\n        \n        \n    def add_(self,s,a):\n        res = \'\'\n        for idx, i in enumerate(s):\n            if idx % 2 == 1:\n                num = (int(i) + a) % 10\n                res += str(num)\n            else:\n                res += i\n                \n        return res\n    \n    \n    def rotate_(self, s, b):\n        idx = len(s)-b\n        res = s[idx:] + s[0:idx]\n        return res\n```
['Breadth-First Search', 'Python']