Problem:
"Babylonians use regular numbers to keep time.
A "regular number" in math is defined to be a number that is a factor of some power of 60 (60, 3600, etc). Equivalently we can say that a regular number is one whose ONLY prime divisors are 2, 3 and 5. The first 10 regular numbers are:
1, 2, 3, 4, 5, 6, 8, 9, 10, 12.
Your task is to find the n-th regular number."
My professor asked us to specifically use priority queue to solve this problem, and the largest number we'll test is no more than n = 300. I'm clueless.
edit: I'm obviously not asking for the complete code, I just need pointers to get me started.
Not sure why the use of PriorityQueue, but a pretty ugly brute force way to solve the question would be something like this.
This produces
[1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80]as output.