An integer n is strictly palindromic if, for every base b from 2 to n - 2 inclusive, the representation of n in base b is a palindrome. Given n, return true if it is strictly palindromic and false otherwise.
An integer n is strictly palindromic if, for every base b from 2 to n - 2 inclusive, the representation of n in base b is a palindrome. Given n, return true if it is strictly palindromic and false otherwise.
Example 1:
Input: {"n":9}
Output: false
Constraints:
4≤n≤105
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"n":9}
n = 9 must read the same forwards and backwards in every base from 2 to 7. Try the bases one by one.