flatland space stations hackerrank solution