@@ -0,0 +1,730 @@
+package com.lc.dp;%0A%0Apublic class TrappingRainWater %7B%0A    public int trap(int%5B%5D height) %7B%0A        if (height == null %7C%7C height.length == 0) return 0;%0A        int len = height.length;%0A        int%5B%5D leftMax = new int%5Blen%5D;%0A        int%5B%5D rightMax = new int%5Blen%5D;%0A        leftMax%5B0%5D = height%5B0%5D;%0A        for (int i = 1; i %3C len; i++) %7B%0A            leftMax%5Bi%5D = Math.max(height%5Bi%5D, leftMax%5Bi-1%5D);%0A        %7D%0A        rightMax%5Blen-1%5D = height%5Blen-1%5D;%0A        for (int i = len-2; i %3E= 0; i--) %7B%0A            rightMax%5Bi%5D = Math.max(height%5Bi%5D, rightMax%5Bi+1%5D);%0A        %7D%0A        int count = 0;%0A        for (int i = 1; i %3C len-1; i++) %7B%0A            count += Math.min(leftMax%5Bi%5D, rightMax%5Bi%5D) - height%5Bi%5D;%0A        %7D%0A        return count;%0A    %7D%0A%7D%0A

Create TrappingRainWater.java