public static long maxWater(int[] arr) { if (arr == null || arr.length <= 2) { return 0; } int left = 0, right = arr.length - 1; long sum = 0; // 找出左右边界的最小值作为水位高度 int mark = Math.min(arr[left], arr[right]); while (left < right...