ALGORITHMICSGitHub ↗
← All tracks

Data Structures & Algorithms

Arrays, trees, graphs, sorting, strings.

35 problems

35/35

  • 01234
    DSA 7 min
    Arrays and Strings

    Why contiguity is the whole advantage, and what it costs when you insert in the middle.

  • DSA 8 min
    Backtracking

    Trying every possibility without trying every possibility — how one rejection prunes a whole branch.

  • DSA 8 min
    Binary Search

    Why halving beats scanning, and the one sentence that has to stay true for the loop to be correct.

  • 00101100= 44
    DSA 7 min
    Bit Manipulation

    What integers actually look like in memory, and the handful of tricks worth memorising.

  • ··no two adjacent
    DSA 5 min easy
    Can Place Flowers

    Plant as early as possible — and the function that quietly rewrites its caller's garden.

  • numsnums again
    DSA 6 min easy
    Concatenation of Array

    A three-line problem that is really about Go slices — capacity, copying, and who owns the array.

  • 27379seen twice
    DSA 6 min easy
    Contains Duplicate

    The first problem where a set beats a nested loop — and what Go uses for a set.

  • DSA 9 min
    Dynamic Programming

    Recursion that stops repeating itself — and how to find the state that makes it work.

  • DSA 9 min
    Graphs and Shortest Paths

    Four algorithms, and the one property of your graph that decides which of them is allowed.

  • DSA 8 min
    Greedy

    Take the best option in front of you — and the proof you owe before you are allowed to.

  • eatteatanbataetantabt
    DSA 6 min medium
    Group Anagrams

    A canonical key turns grouping into one map insert — and Go lets the key be an array.

  • 012
    DSA 8 min
    Hash Maps

    Why average O(1) is a statement about spread, and what happens when the spread fails.

  • max
    DSA 7 min
    Heaps and Priority Queues

    A tree hidden inside an array, and why knowing less is cheaper than knowing everything.

  • ahbgdcabc
    DSA 6 min easy
    Is Subsequence

    Two pointers that only move forward — and the byte-versus-rune slip that crashes it.

  • egadand back again
    DSA 6 min easy
    Isomorphic Strings

    A consistent one-to-one substitution — and why checking one direction is not enough.

  • Hi you!·
    DSA 4 min easy
    Length of Last Word

    Two lines with the standard library, or one backwards scan — and why the trailing space is the whole problem.

  • DSA 7 min
    Linked Lists

    Pointer surgery without losing the list, and the dummy node that removes every edge case.

  • flowflowfligfl
    DSA 5 min easy
    Longest Common Prefix

    Compare down the columns, not along the words — and stop at the first disagreement.

  • a
    DSA 6 min easy
    Majority Element

    Boyer-Moore voting — constant space, and only correct because the problem promises something.

  • DSA 7 min
    Matrix Traversal

    Grids are graphs with invisible edges — and the direction array that keeps the code honest.

  • DSA 8 min
    Merge Sort

    Divide until trivial, then merge — and why the recursion tree gives you the running time for free.

  • DSA 7 min
    Merging Intervals

    Sort by start, sweep once — and the off-by-one that decides whether touching ranges count.

  • DSA 8 min easy
    Next Greater Element

    How a monotonic stack turns a quadratic scan into one pass, and why the stack can never stop being decreasing.

  • 111121
    DSA 5 min easy
    Pascal's Triangle

    Each row from the one above it — the smallest dynamic programming table there is.

  • 22333k
    DSA 5 min easy
    Remove Element

    Removing in place without shifting — one boundary, one pass, and what the return value really is.

  • 18661-1scan backwards
    DSA 5 min easy
    Replace Elements with Greatest Element on Right Side

    Walk backwards and the quadratic scan disappears — the smallest suffix-aggregate problem.

  • abcba
    DSA 7 min
    Sliding Window

    Why the window never moves backwards, and how that turns a quadratic scan linear.

  • DSA 6 min
    Stacks and Queues

    Two rules for "what next", and why the choice changes which order you explore.

  • 12534
    DSA 7 min
    Trees and Traversals

    Four orders, one recursion, and what each one is actually for.

  • cdao
    DSA 7 min
    Tries

    Paying per character instead of per string, and when that trade is worth it.

  • lohi
    DSA 7 min
    Two Pointers

    One pass instead of two loops, and the ordering property that makes discarding safe.

  • 27111539 − 2 = 7
    DSA 6 min easy
    Two Sum

    Store what you need, not what you have — the inversion that makes one pass enough.

  • DSA 7 min
    Union-Find

    Keeping track of who is connected to whom, and the two one-line tricks that make it nearly free.

  • a.b+c@x.comab
    DSA 4 min easy
    Unique Email Addresses

    Normalise, then count the set — and the one part of the address you must not touch.

  • abccaball 0
    DSA 7 min easy
    Valid Anagram

    One tally instead of two — and the Unicode bug hiding in the obvious Go solution.

Coverage

35 of 35 problems