Why “Accepted” Shouldn’t End Your LeetCode Learning

https://hackernoon.imgix.net/images/2jqChkrv03exBUgkLrDzIbfM99q2-ts0226h.jpeg

I Used to Think "Accepted" Meant I Was Done Learning

Whenever I solve a LeetCode problem, I have a simple objective.

Get the green Accepted badge.

Move on to the next problem.

For a long time, I never questioned that habit.

Recently, while solving Matrix Diagonal Sum, something changed.

Not because the problem was difficult.

Not because I found a faster algorithm.

But because another accepted solution made me realize that I had been treating "Accepted" as the finish line.

Maybe it isn't.

Maybe it's the beginning of another kind of learning.

My Solution Was Accepted

For the problem, I naturally separated the computation into two parts.

The primary diagonal.

The secondary diagonal.

Even though both could be traversed in a single loop, my mind treated them as two independent responsibilities.

So I maintained two variables.

One for each diagonal.

After both sums were computed, I handled the only...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more