Trapping Rain Water(Leetcode-42)

Please explain the two pointer approach to solve the problem.