The Lucky Numbers
CodeChefOpen on judge ↗
A person 'M' is obsessed with finding lucky numbers. He believes that a number is lucky if the sum of the digits on the right side and left side (which can have either n or n-1 digits) of the square of the number is equal to the original number itself. In other words, if he takes an n-digit number k, calculates its square, and then adds up the right n digits and the left n or (n-1) digits of the s
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start