The problem’s link: https://www.hackerrank.com/challenges/flatland-space-stations/problem This problem’s difficulty level is EASY, but to be honest, the solution didn’t pop up into my mind straight away after reading the description. However, I found one way which is easy understanding and light code to solve it. I won’t explain the requirement here, so…