LeetCode solutions

2481. Strictly Palindromic Number

My accepted Python solution to LeetCode problem 2481, Strictly Palindromic Number, running in 0ms.

  • Difficulty: Medium
  • Python
  • Runtime 0ms
  • Memory 17MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 17MB, accepted 2026-01-01.

python
class Solution:
    def isStrictlyPalindromic(self, n: int) -> bool:
        # For any n >= 4, n in base (n-2) is always "12" which is not palindromic
        # Therefore, no number >= 4 is strictly palindromic
        return False

Source