← All problemsSign in

2523. Closest Prime Numbers in Range

LeetCodeMathNumber TheoryOpen on judge ↗

Given two positive integers left and right, find the two integers num1 and num2 such that: - left <= num1 < num2 <= right . - Both num1 and num2 are prime numbers. - num2 - num1 is the minimum amongst all other pairs satisfying the above conditions. Return the positive integer array ans = [num1, num2]. If there are multiple pairs satisfying these conditions, return the one with the smallest nu

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start