What is the difference between both?

ll pre[1000005] = {0};
and
memset(pre,0,sizeof(pre));

due to this difference there was difference between passing of test cases… plz help

hi @yamangoyal100_ff74db54bdf01539 share the code

plz check :
----> https://ide.codingblocks.com/s/668016

hi @yamangoyal100_ff74db54bdf01539 the difference is that u r doing memset for every test case but when declaring = {0} u r doing it only once. So its failing for test cases where t > 1

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.