双指针
Data Structures & Algorithms · 4 notes
- Trapping Rain Waterhistorical
Given n non-negative integers representing an elevation map where each bar has width 1, calculate how much rain water can be trapped after raining.
- Container With Most Waterhistorical
Given the heights of vertical lines, choose two lines that form a container with the horizontal axis and maximize its water-holding area.
- Move Zeroeshistorical
Given an array nums, write a function to move all 0s to the end of the array while preserving the relative order of the non-zero elements.
- Product of Array Except Selfhistorical
Given an integer array nums of length n, where n > 1, return an output array output where output[i] equals the product of all elements in nums except nums[i].