TikTok Interview Question

It was the Asteroid problem on leetcode