Search⌘ K
AI Features

Solution: Kth Smallest Prime Fraction

Solution: Kth Smallest Prime Fraction gives a sorted array beginning with 1 and prime values, then asks you to return the numerator and denominator of its kth smallest fraction formed from an earlier numerator and later denominator.

Statement

You are given a sorted array of unique integers, arr, which includes the number 11 and other prime numbers. You are also given an integer kk.

For every index ii and jj where 0≤i<j<0 \leq i < j < arr.length, you can form a fraction by taking the number at index ii as the numerator and the number at index jj ...