We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
1a. Make sure your code can correctly represent such a large number
1b. You won't have enough time to do anything for each cell in the grid (even if you spent 1 nanosecond per cell, 1e18 cells would take 30 years).
2. Don't miss the very important note: "A train track may overlap other train tracks within the same row." Consider how this problem might be solved if that weren't true (it would be very easy), and how it changes because of that statement.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Gridland Metro
You are viewing a single comment's thread. Return to all comments →
Some hints:
1. The grid can be very large (1e18)
1a. Make sure your code can correctly represent such a large number
1b. You won't have enough time to do anything for each cell in the grid (even if you spent 1 nanosecond per cell, 1e18 cells would take 30 years).
2. Don't miss the very important note: "A train track may overlap other train tracks within the same row." Consider how this problem might be solved if that weren't true (it would be very easy), and how it changes because of that statement.