This is not meant to be as the ultimate answer to the puzzle. It is just one of the myriad approaches that can solve it.
Feel free to contribute improvements or discuss alternate approaches.
If you want to submit an improvement:
Fork, clone the repo:
git clone [email protected]:your-username/mars_explorer.git
Setup your machine:
./bin/setup
Make sure the tests pass:
rake
Make your change. Add tests for your change. Make the tests pass:
rake
Push to your fork and submit a pull request.