GeeksforGeeks » GPuzzles
10 digit problem
(9 posts)-
device a 10 digit number such that
a] each digit represents the number of zeros following it(eg 9000000000)
b] such that sum of non zero digits in this number is maximumfrom my side the answer is 5555500000, please suggest if there is a better
answer -
9999500000
-
1111111110
This is the only solution possible.
bcoz last digit will always be 0
so 2nd last has to be 1
so 3rd last also has to be 1
and so on.... -
The best answer appears to be 5555500000, as this gives the maximum sum of the non-zero digits.
-
@piyush your answer is right.
-
Solution of above problem http://anandtechblog.blogspot.com/2011/07/find-8digit-number-microsoft-interview.html
-
@Varun Kumar your answer is right.
if considering solution 55555(0)0000....the zero inside brackets implies there should be no zero after it.
so the only solution possible is 1111111110 -
Why can't the answer be "9000000000"
-
what about 1010101010?
1st 1 means 1 zero will follow it
After that, 0 implies zero 0's follows it.
Repeating like that, we will get 1010101010. (If we are talking about zeros directly following the previous digit.)
Reply
You must log in to post.