(matrix [][]int, pr, pc, ro, co, rd, cd int)
| 162 | } |
| 163 | |
| 164 | func waterCanFlow(matrix [][]int, pr, pc, ro, co, rd, cd int) bool { |
| 165 | // if the next flow destination has reached pacific, atlantic, |
| 166 | // or has a value less than or equal to the origin value |
| 167 | return (pr != rd || pc != cd) && |
| 168 | (reachedAtlantic(matrix, rd, cd) || |
| 169 | reachedPacific(rd, cd) || |
| 170 | matrix[ro][co] >= matrix[rd][cd]) |
| 171 | } |
no test coverage detected