1427. Perform String Shifts Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1427class Solution: def stringShift(self, s: str, shift: List[List[int]]) -> str: x = sum((b if a else -b) for a, b in shift) x %= len(s) return s[-x:] + s[:-x]