This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given a 2d array of integers between 0-9. Check the path from each of the integers toward any edge of the array. Only straight paths needs to be considered, up, down, right, left. Count how many of the integers have lower integers on the path towards any edge. | |
Then multiply the count in each direction together up*down*left*right and assign store that count as a score for that integer. | |
Integers on the edge will always have a score of zero. | |
The input will be in this format and should be read from a file called sample.txt | |
30373 | |
25512 | |
65332 | |
33549 | |
35390 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment