Robot Collisions Leetcode Solution