/challenges

Many of programming challenges.

Primary LanguageJava

Challenges

Many of programming challenges.

Challenge 1 - Water Volume (It took me about 6 hours to solve)

Estimate the volume of water in the lakes.
2D Array of 0's and 1's.
1 if it's water, - 0 if it's land. To estimate water element (i,j) is 1. They computer the shortest straight-line desbalance from the land in the four directions.
The volume of the sections indicated by 1 is assumed to be proporcional to the distance: that us if (i,j) is adjacent to an element of 0, its volume is 1, if it is K elements away from closest land (on element of 0), its volume is K;