🌱SproutStack
👤 Guest

🌱 DSA (Beginner) · Core Patterns · cozy lesson

Hash Tables & Counting

11 min · 1 min read · no scary math, promise

🤖
You’ve got this. Read a little, play a little — I’ll wait. No rush.
def two_sum(a, t):
    m = {}
    for i, x in enumerate(a):
        if t-x in m: return [m[t-x], i]
        m[x] = i

Pattern: counting → Counter, grouping → dict of lists (anagrams by sorted key).

Check your understanding

Correct answers earn XP (once each).

1. Two Sum O(n)?

2. Anagram check?

My notes (saved in this browser)

Select text above → Save selection, or write your own. AlgoMaster-style notebook, local-first for MVP.

No notes yet. Your highlights will live here.

Finished reading? Seal it with a tick ✅

The checkbox in the explorer turns green too — same progress.