Skip to main content

Palindrome Number

Challenge on lesson: Checkpoint — Loops

CHALLENGE
Difficulty: beginner+25 XP

**Description:** Given a positive integer n, print PALIN if its decimal digits read the same left-to-right and right-to-left, else NO. **Input:** One integer n (1 ≤ n ≤ 10^18). **Output:** PALIN or NO. **Example:** 12321 → PALIN; 1234 → NO. **Constraints:** 50% of tests have n ≤ 10^9; 100% have n ≤ 10^18.

Back to lesson: Checkpoint — Loops