반응형
Nearly every one have used the Multiplication Table. But could you find out the k-th smallest number quickly from the multiplication table?
Given the height m and the length n of a m * n Multiplication Table, and a positive integer k, you need to return the k-th smallest number in this table.
k번째 작은 수를 구해야한다.
m 높이 , n 넓이
Example 1:
Input: m = 3, n = 3, k = 5
Output:
Explanation:
The Multiplication Table:
1 2 3
2 4 6
3 6 9
The 5-th smallest number is 3 (1, 2, 2, 3, 3).
테이블에 있는 값을 한 배열에 넣어주고 5번째 값 구하면 되지 않을까? -- 안됨 최대갯수 30,000 * 30,000 임
반응형
'Leetcode' 카테고리의 다른 글
Leetcode <Sort> 1235. Maximum Profit in Job Scheduling 44.1% Hard (0) | 2020.04.11 |
---|---|
Leetcode <Binary Search> 287. Find the Duplicate Number 53.1% Medium (0) | 2020.04.10 |
Leetcode <Sort> 1366. Rank Teams by Votes 50.6% Medium (0) | 2020.04.10 |
Leetcode <Binary Search> 704. Binary Search 50.8% Easy (0) | 2020.04.10 |
Leetcode <Sort> 242. Valid Anagram 백준 6996번 애너그램 (0) | 2020.04.05 |
댓글