"If you are using your own declared global variables, make sure to clear them out

"If you are using your own declared global variables, make sure to clear them out in the constructor."
how to clear them out in constructor

1 Like

Reset them to some default value.
For example, if you are using map<int, int> M as global variable, I will clear it out in the constructor by doing M.clear();

Click here to start solving coding interview questions