You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[363. Max Sum of Rectangle No Larger Than K](src/problem/p0363_max_sum_of_rectangle_no_larger_than_k.rs)
326
+
* Two related subproblems:
327
+
* Max Sum Submatrix (KaDane's Algorithm)
328
+
* Subarray with the sum no larger than k (Compute during the Merge Sort, similar to [327. Count of Range Sum](src/problem/p0327_count_of_range_sum.rs))
* Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array.
5
+
* Return the minimum number of patches required.
6
+
*
7
+
* Example 1:
8
+
*
9
+
* Input: nums = [1,3], n = 6
10
+
* Output: 1
11
+
* Explanation:
12
+
* Combinations of nums are [1], [3], [1,3], which form possible sums of: 1, 3, 4.
13
+
* Now if we add/patch 2 to nums, the combinations are: [1], [2], [3], [1,3], [2,3], [1,2,3].
14
+
* Possible sums are 1, 2, 3, 4, 5, 6, which now covers the range [1, 6].
* You start at point (0,0) on an X-Y plane and you move distance[0] meters to the north, then distance[1] meters to the west, distance[2] meters to the south, distance[3] meters to the east, and so on. In other words, after each move, your direction changes counter-clockwise.
6
+
* Return true if your path crosses itself, and false if it does not.
0 commit comments