how to form a largest number with the digits of a given number
Answers
Answered by
3
HEYA!!!
HERE IS YOUR ANSWER,
> We know that the digits in a number will range from 0-9, so the idea is to create a hashed array of size 10 and store the count of every digit in the hashed array that occurs in the number.
> Then traverse the hashed array from index 9 to 0 and calculate the number accordingly.
HOPE IT HELPS YOU,
THANK YOU.☺️☺️
HERE IS YOUR ANSWER,
> We know that the digits in a number will range from 0-9, so the idea is to create a hashed array of size 10 and store the count of every digit in the hashed array that occurs in the number.
> Then traverse the hashed array from index 9 to 0 and calculate the number accordingly.
HOPE IT HELPS YOU,
THANK YOU.☺️☺️
Answered by
4
Thank you for asking this question. This question is really easy to solve.
Its really simple to form a largest number if you have been given a few numbers.
Simply you just have to write all the numbers one by one in descending order. Like if youve been given the numbers 2, 1, 0, 5, 3 you can simply write 53210.
I hope this answer can help you in some manner.
Its really simple to form a largest number if you have been given a few numbers.
Simply you just have to write all the numbers one by one in descending order. Like if youve been given the numbers 2, 1, 0, 5, 3 you can simply write 53210.
I hope this answer can help you in some manner.
Similar questions