How to find sum of a given number as sum of two oter numbers given they do not contain a speific digit
Answers
Answered by
12
We have two numbers in their decimal representations, A=a1a2...an and B=b1a2...bm.
A < B if length of A < length of B or ai=bi from left to right until there is a digit ai < ai.
Digits yj can have any values (0-9) for j>i
To find all numbers less than a particular number say X, satisfying a particular property, we iterate the number by replacing its digits such that it is less than X. If this number satisfies the property, increment the count.
Hope this helps ☺️☺️
Similar questions