Amazon Online Assessment 2021 (OA) - Pth Factor
We've got a task that we need to solve together: let's figure out the factors of a certain number. Factors are just those positive integers that can divide into our number perfectly; no remainders or fractions allowed. Once we have the full list, we've got to sort them in ascending order; from the smallest to the largest. Then, our job is to find the number that sits in the pth position of our sorted list. However, not all positions might have a number sitting there, so if there is no pth element, we simply return 0.
Relevant Amazon OA Problems:
n = 20 p = 3
4
1<=n<=10^151<=p<=10^9