We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9ae020 commit 795e9a4Copy full SHA for 795e9a4
Binary_Search/2040.Kth-Smallest-Product-of-Two-Sorted-Arrays/Readme.md
@@ -18,6 +18,8 @@
18
#### 方法2:
19
类似1918,我们也可以用双指针的单调性来实现o(n)的```countSmallerOrEqual(m)```,不过讨论起来就更复杂了。
20
21
+```nums[i]* nums[j] <= m```
22
+
23
1. m>=0
24
(i) nums[i]>0: 我们有 nums2[j] <= m/nums1[i]。可以知道nums2[j]有个上界,且随着nums1[i]的增大,这个上界越来越小。所以我们从大到小单调地移动j,找到与i对应的临界位置j,那么[0:j]都是合法的解。
25
(ii) nums[i]==0: 所有的nums2都是解。
0 commit comments