Red Hat Interview Question

Pacific-Atlantic water flow problem [leetcode]