Help With My Solution Of [CLEANUP]

This is the Problem Link:-


This is My solution:-
https://www.codechef.com/viewsolution/28048571
My Solution Pass All Test Cases Visible and i want to Know What is Wrong with it.

You’re not initialising the contents of arr, so they will be essentially unpredictable.

1 Like

Yeah thanks submitted AC but in my machine which uses gcc it always initialised with 0 so, i didn’t thought to initialise.

1 Like

That’s why uninitialised stuff is so dangerous :slight_smile:

1 Like