flipkart | SDE-3 | DSA

1961
Jan 22, 2024

company : Flipkart
Role: SDE-3
Round - second round- DSA

Q1. There is a sequence that contains in ascending order natural numbers that are products of at least two natural consecutive numbers, of which the following is an example: 2, 6, 12, 20, 24, 30, 42, 56, 60, 72 ...
2 is a product of the consecutive natural numbers 1 and 2. Likewise, 6 = 2 × 3 or 6 = 1 × 2 × 3, 20 = 4 x 5, 60 = 3 × 4 × 5, and so on, all of which are products of two or more consecutive natural numbers.

Return nth smallest number from the above sequence.

If n = 3 Ans = 12
If n = 5 Ans = 24

Comments (3)