If I write this
ans += st.top().first;
my program runs fine but if I replace it with this
ans = ans + st.top().first;
which is one at same it comes time limit exceeded. Can someone please tell me?
If I write this
ans += st.top().first;
my program runs fine but if I replace it with this
ans = ans + st.top().first;
which is one at same it comes time limit exceeded. Can someone please tell me?