In this article, we have solved the problem of finding the K-th Smallest Number in Multiplication Table. This involve the concept of Binary Search.
PROBLEM STATEMENT
Suppose we have an m x n matrix named mat, which represents the multiplication table of integers from 1 to m and 1 to n. The element at row i and column j in mat is the product of i and j.
Given three positive integers m, n, and k, find and return the kth smallest element in the matrix mat.
EXAMPLE
Example 1:
Input: m = 2, n = 3, k ...
Published on March 04, 2023 05:52