Error detection

prob: https://hack.codingblocks.com/app/contests/1975/931/problem

sol: https://ide.codingblocks.com/s/383141

please help in finding the error I want to do it using this logic only

Hey @raghav007 i guess you haven’t understood the approach well.
Follow this:

  • Take input in two different arrays
  • Then start traversing from the back of the array using while loop
  • Maintain a variable which will have carry of these two index some
  • traverse from back not from start. Moreover don’t generalise the size of an array on your own like you did in you code by doing 100, either make it of n1 size of of the given constraints given

yeah Im not taking the size of the array correctly but i think Im traversing the array from the back.

I even tried to debugged your code, but you have taken unnecessary variables which is creating chaos in your code. Run time error is because of your first while loop.
See this code and try to implement like this

sol: https://ide.codingblocks.com/s/383208
1 digit is shown to be incorrect please check.

found it, just = sign was missing in while loop

Have debugged it

Also have to print carry too, cause of input
5
9 9 9 9 9
4
9 9 9 9

oh okay, but 2 test cases are not passing

Yes i have given the input of those test cases also, its running perfectly fine. I would suggest you to open those test cases and you will see that the output coming is same as of the required output. Might be some glitch.

https://hack.codingblocks.com/app/contests/1975/173/problem
sol : https://ide.codingblocks.com/s/383370

Im not able to print the commas correctly please run the code and see

Hey @raghav007 please ask new doubt for new problem.

yeah I know but I wanted you to see this problem

I will acknowledge your new doubt, don’t worry. Just post a new doubt :slight_smile:

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.