← back to unit
Challenge
# puzzle gauntlet advanced
The Number Mirror
Is 12321 a mirror number? Sure — but prove it WITHOUT strings. Pure math: peel digits off one end and build a new number from them. 🔢
You get a positive n. Reverse its digits using only math (%, //, ×), then print mirror if the reversal equals the original, else not a mirror.
Example:
Input: n = 12321
Output: mirror
Peeling digits off with % 10 and // 10 and rebuilding the number backwards gives 12321 right back, matching the original.
💡 need a hint?
pg-number-mirror.py🔒 given lines are locked — write your code in between
loading...