You are given an integer n.
Let r be the integer formed by reversing the digits of n.
Return the sum of all prime numbers between min(n, r) and max(n, r), inclusive.
Example 1:
Input: n = 13
Output: 132
Explanation:
[13, 31].13 + 17 + 19 + 23 + 29 + 31 = 132.Example 2:
Input: n = 10
Output: 17
Explanation:
[1, 10].2 + 3 + 5 + 7 = 17.Example 3:
Input: n = 8
Output: 0
Explanation:
[8, 8].Constraints:
1 <= n <= 1000Loading editor...
13