Z56
Kth Smallest Number in Multiplication Table
Problem Statement & Objective
Nearly everyone has used the Multiplication Table. Given m, n, and k, return the kth smallest number in the m x n multiplication table.
Function Signature (Python)
find_kth_number_multiplication_table(m: int, n: int, k: int) -> intInput & Output Contract
Output Rule:k'ıncı en küçük sayı tam sayısı.
System Constraints
1 <= m, n <= 3 * 10^4
1 <= k <= m * nExample Execution Walkthrough
m = 3, n = 3, k = 5
tablo: [1,2,3, 2,4,6, 3,6,9] -> sıralı: [1, 2, 2, 3, 3, 4, 6, 6, 9] -> 5. eleman 3Example Test Scenarios (3)
Example 1
Input:
[3,3,5]Expected Output:
3Example 2: Son Eleman
Input:
[2,3,6]Expected Output:
6Example 3: 1x1
Input:
[1,1,1]Expected Output:
1