Form Biggest Number - my approach

My solution: https://ide.codingblocks.com/s/404116

Question: https://online.codingblocks.com/app/player/178555/content/173727/5316/code-challenge

When I run against custom input, I’m getting correct answer. But, all my test cases are failing.
Can you tell me why my approach is wrong? I’ve seen the solution. Just tell me why is my approach wrong.

Hello @mohaktrivedi please recheck your code is perfectly fine and passing all the test cases .https://ide.codingblocks.com/s/404116?_ga=2.41398502.531836111.1605425451-106244939.1599922571
refresh the page and try to submit it again :
Happy Learning!!

Hello @Tushar Aggarwal !

I tried again, but still all the test-cases are failing. I don’t know why. When I compile it, it gives the correc answer

Hey @Tushar Aggarwal ! I added cout<<endl; and now the 0th test-case is passing, but all others are failing. I think there’s a problem in my code. Can you please check it out? :slight_smile:

okay i got it.
but dint you think @mohaktrivedi that you are unnecessarily complecating it.
if you will do it using string array then you will find it very easy and understandable.
please tell me if you want me to discuss.

Hi @Tushar Aggarwal ! I have understood the solution, but, I am just curious regarding what’s wrong with the approach used by me. I don’t have any other issue related to this challenge.

Hello @mohaktrivedi just use the data type as long long int and your code will pass all the test cases:
Happy Learning!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.