今際の国の呵呵君
Wednesday, November 22, 2017
[LeetCode]Kth Smallest Number in Multiplication Table
乘法表就是从左向右,自上而下递增的2D matrix。所以我们可以采用和
Kth Element in Sorted Matrix
一样的解法。也就是值域上的2分法。时间复杂度O(m * log (m * n)),代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment