(int k)
| 25 | } |
| 26 | |
| 27 | public static int getKthMagicNumber(int k) { |
| 28 | if (k < 0) { |
| 29 | return 0; |
| 30 | } |
| 31 | int val = 1; |
| 32 | Queue<Integer> q = new LinkedList<Integer>(); |
| 33 | addProducts(q, 1); |
| 34 | for (int i = 0; i < k; i++) { // Start at 1 since we've already done one iteration |
| 35 | val = removeMin(q); |
| 36 | addProducts(q, val); |
| 37 | } |
| 38 | return val; |
| 39 | } |
| 40 | |
| 41 | public static void main(String[] args) { |
| 42 | for (int i = 0; i < 14; i++) { |
no test coverage detected