668. Kth Smallest Number in Multiplication Table
668. Kth Smallest Number in Multiplication Table
Description
Solution
Generally, k-th
related problem could be solved by binary search to guess the right answer and verify
. Once we enumerate a number, we could calculate its rank.
Another important thing we should notice is that we calculate the elements number that less equal
than the target one.
Code
1 | class Solution { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.