The link of question is:
https://hack.codingblocks.com/contests/c/255/104
The link of my code:
http://ide.codingblocks.com/#/s/16747
According to my code it’s passing the given test cases but after submission it’s giving wrong answer
The link of question is:
https://hack.codingblocks.com/contests/c/255/104
The link of my code:
http://ide.codingblocks.com/#/s/16747
According to my code it’s passing the given test cases but after submission it’s giving wrong answer
Hi Aulick,
Don’t make dynamic arrays without using new keyword. Memory for arrays without using it are allocated at compile time. So, either make arrays of 1000 or with new. Otherwise, your logic is perfectly fine.
Your code is working fine. Can you please tell what’s wrong with my code? I am not able to figure it out. Your logic seems similar to mine
Hey, there is no problem in your logic. The only reason it is failing some test cases is becoz you are not updating the values of sum1, sum2 to 0 in each test case. Try that. It should work
Getting the same problem but my array initialization is correct. Please find below the link for my code and tell me where I am doing it wrong.
https://ide.codingblocks.com/#/s/29121
array initialisation is not correct.
int arr[] is not allowed
int arr[1000] or int arr[N] is allowed