Favorite Digits
CodeChefOpen on judge ↗
Giri was a fat boy and always spent a lot of money on Thalapakatti dinners. He had immense liking for two digits, lets call them x and y. Giri claims that a number is "tasty" if it only contains its digits as x and y. For example, if x=1 and y=3, numbers such as 1313 , 11 , 3 are some examples of tasty numbers for Giri. Giri calls a tasty number "nasty", if the sum of the digits in the number is
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