@@ -0,0 +1,277 @@
+public int sumHeights2(int%5B%5D heights, int start, int end) %7B%0A  int totalDiff = 0;%0A  for (int i = start; i %3C end; i++) %7B%0A    if (heights%5Bi%5D %3C heights%5Bi + 1%5D) totalDiff += (heights%5Bi+1%5D - heights%5Bi%5D) * 2;%0A    else totalDiff += heights%5Bi%5D - heights%5Bi+1%5D;%0A  %7D%0A  return totalDiff;%0A%7D%0A

Create sumHeights2.java