https://github.com/const-ae/skiinginsingapore
My solution for the coding challenge published by RedMart.
https://github.com/const-ae/skiinginsingapore
Last synced: 11 months ago
JSON representation
My solution for the coding challenge published by RedMart.
- Host: GitHub
- URL: https://github.com/const-ae/skiinginsingapore
- Owner: const-ae
- Created: 2015-08-24T15:59:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-24T16:17:05.000Z (almost 11 years ago)
- Last Synced: 2025-05-14T07:50:25.546Z (about 1 year ago)
- Language: Scala
- Size: 1.76 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SkiingInSingapore
My solution for the [coding challenge](http://geeks.redmart.com/2015/01/07/skiing-in-singapore-a-coding-diversion/) published by RedMart.
The solution is written entirely in Scala.
## Running the code
The main method is in the com.cae.test.Experiment class. Probably the simplest way to run the project would be to import it in IntelliJ IDEA and run from there.
## Possible Improvements
#####The central part of the algorithm is written as a recursive function
This means for long paths the code will throw an StackOverFlowException. The provided input did not lead to such problems but for bigger inputs one will probably have to refactor this part.
#####Performance
The code executes reasonable fast (about 2 minutes multithreaded and about 4 minutes on a single core) for this challenge. But if it were necessary one could improve the runtime by checking if the subsequent paths from an intermediate cell have already been calculated and simply prepend the previous path. This should heavily reduce the necessary computation time.