Can't figure out what is wrong in my code's output

my code’s output matches sample output but still, it is marked wrong in test cases.
I have added some comments in my code to explain my approach. so please try to understand it and tell me how to correct it rather than giving me your solution.

link:

@jainutkarsh0211
Is it giving you just wrong answer or TLE since you are using many for loops.
else could you send me the question link i will check it there.

link: https://online.codingblocks.com/app/player/219807/content/216676/5316/code-challenge

it is giving me wrong answer

you can’t use this logic of making all numbers to 7 digits and comparing them.
for example take this simple test case
2
9 98
in 7 digit they will become
9000000
9800000
here 2nd number is bigger so as per your logic answer will be 989
but 998 should be the correct answer.

1 Like

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.