Arrays - Sum of two arrays, - All tests case going wrong
Arrays ---Challenges
Please share your code so that I can help you find your mistake. Save it to https://ide.codingblocks.com/ and share the link here
Can you please call me and guide to share link
My number is 9999767665
// FINAL ARRAY
int max=Math.max(N,M);
int[] ans=new int[max+1];
System.out.println(max);
int k=ans.length-1;
Your logic is correct, your test cases are failing because of output format. In the above part of code, don’t print the value of max. And since you are fixing the size of your output array, If there is no carry in the end, it will print an extra zero. Consider using an arraylist.
Another thing, you have to print the array elements separated by commas and you also have to print “END” after printing all elements
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.