You are viewing a single comment's thread. Return to all comments →
the conditions are:
1) is right or left of the current value a value that is greater or equals
2) is above or below of the current value a value that is greater or equals
3) is it in the first or last row or is it the first or last number
if so it cant be a cavity
I just created an inverse of a 2 dimensional array and checked those conditions for both matrices. Even its O(N*N) it doesnt needs a 1/10 of a second
Seems like cookies are disabled on this browser, please enable them to open this website
Cavity Map
You are viewing a single comment's thread. Return to all comments →
the conditions are:
1) is right or left of the current value a value that is greater or equals
2) is above or below of the current value a value that is greater or equals
3) is it in the first or last row or is it the first or last number
if so it cant be a cavity
I just created an inverse of a 2 dimensional array and checked those conditions for both matrices. Even its O(N*N) it doesnt needs a 1/10 of a second