TikTok interview question

It was the Asteroid problem on leetcode