Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use Sieve of Eratosthenes to mark numbers that are primes.
Iterate from right to left and find pair with the minimum distance between marked numbers.
Solve with full IDE support and test cases