Description Ugly number is a number that only havefactors 2, 3 and 5. Design an algorithm to find the nth ugly number. The first 10 ugly numbers are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12... Example If n=9, return 10. Challenge O(n log n) or O(n) time. Notic…