← All problemsSign in

Superlucky Numbers

Eshaan and Nischay decided to play a game. Nischay asked Eshaan to choose 2 distinct digits A and B. Eshaan calls a positive integer “lucky”, if it contains only the digits A and B. Nischay calls this number “superlucky” if sum of its digits is “lucky”. For Example : If Eshaan chooses A = 1 and B = 3, then number 12 isn’t lucky but 133 or 1133131 are lucky. Also number 1133131 is superlucky but

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start