Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

LeetCode Medium Problems 75

(a.k.a. Welcome to the Algorithm Hunger Games)

Now that you’ve survived Easy mode, it’s time to enter Medium — the level where your code works on sample tests only.

Medium problems are like business meetings:

  • Everyone looks calm,

  • But deep down, nobody knows what’s happening.


⚔️ What “Medium” Really Means

You’ll meet algorithms with names like “Dynamic Programming,” “Sliding Window,” and “Backtracking.” Each one sounds like a yoga pose but feels like a mild existential crisis.


🧩 Classic Medium Problems

ProblemConceptComedy Summary
3SumTwo pointers“The sequel to Two Sum — now featuring drama.”
Add Two Numbers (Linked Lists)Linked list arithmetic“Because normal addition was too mainstream.”
Group AnagramsHash maps“Because spelling is hard — even for computers.”
Longest Substring Without Repeating CharactersSliding window“Teaches you commitment issues.”
Binary Tree Level Order TraversalBFS“A data structure family reunion.”
Kth Smallest Element in a BSTIn-order traversal“Counting leaves like it’s autumn.”
Word SearchBacktracking“Hide-and-seek for letters — exhausting but fun.”
Combination SumRecursion“The mathematical buffet problem: take everything that fits.”
Top K Frequent ElementsHeap“Who are the influencers of your array?”

🧠 Medium Survival Tips

  1. Draw things. Half the time, your brain just wants a picture.

  2. Name your variables properly. x, xx, and xxx aren’t debugging-friendly.

  3. Expect failure. If your first submission passes, check if you’re dreaming.

  4. Read solutions, not to copy — but to steal wisdom.

Pro Tip: Medium problems are like dating — the key is consistency, not speed.


“Medium isn’t about difficulty. It’s about humility.” 😇


# Your code here

Exercises

Exercise

Implement two_sum(nums, target) that returns a tuple of indices (i, j) whose values sum to target, or None if no pair exists.