Tap here to switch tabs
Problem
Submissions

Problem: Sum of Primes Between Number and Its Reverse

Try to solve the Sum of Primes Between Number and Its Reverse problem.

Statement

You are given an integer n.

Let rev be the integer obtained by reversing the decimal digits of n. Define the range as [min⁡(‘n‘,‘rev‘),max⁡(‘n‘,‘rev‘)][\min(`n`, `rev`), \max(`n`, `rev`)].

Return the sum of all prime numbers located within this inclusive range. If there are no prime numbers in the range, return 00.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Primes Between Number and Its Reverse

Try to solve the Sum of Primes Between Number and Its Reverse problem.

Statement

You are given an integer n.

Let rev be the integer obtained by reversing the decimal digits of n. Define the range as [min⁡(‘n‘,‘rev‘),max⁡(‘n‘,‘rev‘)][\min(`n`, `rev`), \max(`n`, `rev`)].

Return the sum of all prime numbers located within this inclusive range. If there are no prime numbers in the range, return 00.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000