2211. Count Collisions on a Road Обновлено: 2024-03-12 1 мин Algorithms , LeetCode СодержаниеLeetCode problem 2211class Solution: def countCollisions(self, directions: str) -> int: d = directions.lstrip('L').rstrip('R') return len(d) - d.count('S')