The Curious Case of LeetCode 523: Memorize or Prove? I Chose to Learn
I didn’t come to this problem expecting to write anything memorable.
Just another LeetCode prompt. A few lines of Python. Move on.
But this one didn’t go that way.
The top posts gave fast code.
The official solution was clean, short, and — to me — deeply unsatisfying.
I didn’t want the “what.” I wanted the “why.”
So I sat with it longer than I planned.
And once I figured it out, I wrote the kind of explanation I wish I’d found.
First, Try It Yourself
Before we go further, here’s the problem:
https://leetcode.com/problems/continuous-subarray-sum/
Take 10–15 minutes.
Try to understand what it’s really asking — not just to pass the tests, but to know what makes it tick.
Because what I learned from solving it wasn’t just the answer — it was something about how I learn.
What I Didn’t Find
When I searched for help, I found lots of solutions that worked.
They were short, clever, and packed with tricks.
But none of them explained what those tricks meant. They just used them.
So I decided to figure it out myself. From scratch.
I didn’t rush to submit. I wanted to be able to explain it to someone else — or to myself, six months later.
Then This Happened
Once I wrote out my thought process and posted it, I got a reply from another user.
They were ranked much higher than me.
They’d solved far more problems. They could’ve skipped past it completely.
But instead, they left a comment:
“God-tier explanation.”
That meant something to me.
Not because of reputation, but because it reminded me that clarity has value — even when you’re not the fastest. Especially then.
Learning That Sticks
This isn’t a story about a clever trick.
It’s about resisting the temptation to memorize and moving toward understanding. About slowing down just long enough for something to actually sink in.
If you’re curious what I came up with — here’s my explanation:
https://leetcode.com/problems/continuous-subarray-sum/solutions/4556097/super-clear-explanation-actually-beats-9-ogni/
If it helps, or if something’s unclear — let me know. I’d love your feedback.
One Last Thought
The win isn’t always solving fast.
Sometimes it’s when someone says: “You made this make sense.”
That’s the kind of work I want to keep doing.
!