Practice K-th Smallest Prime Fraction
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
K-th Smallest Prime Fraction
Problem Statement
You are given a sorted integer array arr containing 1 and prime numbers, where all the integers of arr are unique. You are also given an integer k. For every i and j where 0 <= i < j < arr.length, we consider the fraction arr[i] / arr[j]. Return the kth smallest fraction considered. Return your answer as an array of integers of size 2, where answer[0] == arr[i] and answer[1] == arr[j].
Source: K-th Smallest Prime Fraction on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
arr = [1,2,3,5], k = 3
[2,5]
# Example 2
arr = [1,7], k = 1
[1,7]
Constraints
Related LeetCode Problems
Practice more problems similar to K-th Smallest Prime Fraction.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.