Solve it once. Revise it twice.
Most people forget a problem a week after solving it. AlgoRung is built around the fix: a fixed method for every problem, and two revisions on a schedule, so a solution moves from "I saw this once" to "I can do this in ten minutes".
The loop
- 0
Learn the pattern
Read the topic guide or watch the animated walkthrough. Look for the idea, not the code.
- 1
First solve
Code it yourself. When you get stuck, write down where before you open a solution.
- 2
Revision 1
A few days later, solve it again from a blank editor. Log your time, attempts and every mistake.
- 3
Revision 2
Two days after that, one more clean run. Under ten minutes in one attempt and the problem is yours.
How to approach any problem
The same eight steps for every problem. They also match what interviewers look for: you understand the question, you test your own ideas, and you talk through trade-offs before you write code.
- Read the question twice. Most wrong answers start with a misread constraint.
- Run an example. Work one input by hand to check you understood the question.
- List the edge cases. Empty input, one element, duplicates, negatives, the largest input.
- Find a brute force. Test it on your edge cases before moving on.
- Explain it. Say the approach out loud with its time and space complexity, as you would to an interviewer.
- Optimise. Test the faster version on the same edge cases.
- Explain it again. The optimised approach and its complexity.
- Code. Only now, and only what you explained.
Stuck after the brute force?
Walk down the complexity ladder and ask which step the constraints allow: O(n³), O(n² log n), O(n²), O(n log n), O(n), O(log n), O(1). Or trade memory for time: a hash map, a prefix array or a stack often removes a loop.
What you log
- Time, including the time spent reading the problem.
- Attempts: how many runs it took to pass.
- Mistakes, even small ones. This list is what you read before an interview.
The goal for every problem is the same: under ten minutes, in one attempt.
Where to start
Open the DSA sheet and work through the topics in order, or jump to a pattern you want to practise. Every problem page has the write-up, Java solutions and, for most problems, an animated walkthrough.