i can’t figure out why i am getting test-case fail
Test-case failure
@tusharbhardwaj127 size of output will be bigger than the size of largest array, but you are making res array of size 100 only.
Or make the size of all arrays 1005.
If this resolves your doubt mark it as resolved.
i changed the size but it still doesn’t work.
@tusharbhardwaj127 you are not taking care of the case when res size will be more than given array size, also res[-1] will give run time error or garbage in C++, second thing you need not check val to be greater than 10 or less than 10, you can simply take modulo of val for res[i] and val/10 as carry.
Here code for your reference
If this resolves your doubt mark it as resolved.