Tutorials

Learn to code, one lesson at a time

Choose a learning path and follow the lessons in order. Mark each lesson complete as you go. Your progress is saved in this browser.

HTML

20 lessons

The language for building web pages. Start here if you are new to web development.

Lesson 1

HTML Introduction

What HTML is, what a web page is made of, and your first complete HTML page that you…

4 min read
Lesson 2

HTML Editors

Write HTML on your own computer: create your first .html file in Notepad or TextEdit, then set up…

4 min read
Lesson 3

HTML Basic Structure

The outline every HTML page shares: doctype, html, head, title, meta tags and body, what each one does…

4 min read
Lesson 4

HTML Elements

How HTML elements work: opening and closing tags, content, nesting elements correctly, empty elements like br and img,…

5 min read
Lesson 5

HTML Attributes

Attributes give elements extra information: href for links, src and alt for images, lang, title, id and class,…

4 min read
Lesson 6

HTML Headings

The six heading levels from h1 to h6, how to build a clear outline with them, and why…

4 min read
Lesson 7

HTML Paragraphs

How the p element works, why browsers ignore your extra spaces, and when to use line breaks, horizontal…

4 min read
Lesson 8

HTML Text Formatting

Bold, italic, highlighted, small, deleted, inserted, subscript and superscript text, and the difference between strong and b, em…

5 min read
Lesson 9

HTML Links

Create links with the a element: absolute and relative URLs, opening links in a new tab safely, linking…

4 min read
Lesson 10

HTML Images

Add images with the img element, write useful alt text, set width and height, choose the right file…

4 min read
Lesson 11

HTML Lists

Unordered, ordered and description lists, nested lists, numbering options and why navigation menus are built from lists.

5 min read
Lesson 12

HTML Tables

Build tables with table, tr, th and td; add headers, captions and sections; merge cells with colspan and…

5 min read
Lesson 13

HTML Div and Span

Block and inline elements explained, and how the generic div and span containers group content for styling and…

4 min read
Lesson 14

HTML Classes and IDs

Name elements with the class and id attributes, use them from CSS and JavaScript, and learn the naming…

4 min read
Lesson 15

HTML Forms

How forms collect information: the form element, action and method, labels, text inputs, the name attribute and submit…

5 min read
Lesson 16

HTML Form Inputs

Every common input type, from email, number and date to checkboxes, radio buttons and dropdowns, plus built-in validation…

6 min read
Lesson 17

HTML Semantic Elements

Describe the parts of a page with header, nav, main, article, section, aside and footer, and see why…

5 min read
Lesson 18

HTML Media (Audio and Video)

Play sound and video with the audio and video elements, offer several file formats, add captions, and embed…

4 min read
Lesson 19

HTML Accessibility Basics

Make pages everyone can use: who relies on accessibility, keyboard access, alt text, labels, contrast, headings, landmarks and…

5 min read

CSS

20 lessons

The language for styling web pages: colours, layouts, Flexbox, Grid and responsive design.

Lesson 1

CSS Introduction

What CSS is, how a CSS rule is built from a selector and declarations, and why separating style…

3 min read
Lesson 2

How to Add CSS

The three ways to add CSS (inline styles, internal style elements and external stylesheets), when to use each…

4 min read
Lesson 3

CSS Selectors

Element, class, id, group, descendant, child, attribute and pseudo-class selectors, plus specificity, the rule that decides which style…

5 min read
Lesson 4

CSS Colors

Colour names, hex codes, rgb, hsl and transparency, how to pick a small colour palette, and how to…

4 min read
Lesson 5

CSS Backgrounds

Background colours, images, repeat, position, size, cover and contain, gradients and the background shorthand, with a hero banner…

4 min read
Lesson 6

CSS Borders

Border width, style and colour, single sides, the border shorthand, rounded corners with border-radius, circles, outlines and box…

4 min read
Lesson 7

CSS Margin and Padding

The difference between padding (space inside) and margin (space outside), the one-to-four value shorthand, centring with auto, and…

4 min read
Lesson 8

CSS Box Model

Every element is a box of content, padding, border and margin. Learn how its size is calculated, why…

4 min read
Lesson 9

CSS Width and Height

Set sizes with px, %, rem, vw and vh, use max-width and min-height for flexible layouts, and control…

4 min read
Lesson 10

CSS Text and Fonts

Font families and fallbacks, web fonts, size, weight and line height, alignment, decoration, transform and spacing, plus rules…

4 min read
Lesson 11

CSS Display

How the display property controls layout: block, inline, inline-block, none, flex and grid, plus hiding elements correctly with…

4 min read
Lesson 12

CSS Position

Static, relative, absolute, fixed and sticky positioning explained with badges, overlays, sticky headers and back-to-top buttons, plus z-index…

4 min read
Lesson 13

CSS Flexbox Basics

Lay out items in a row or column with Flexbox: flex containers, direction, justify-content, align-items, gap and wrapping,…

6 min read
Lesson 14

CSS Flexbox Layouts

Control flex items with flex-grow, flex-shrink, flex-basis and the flex shorthand, then build a sidebar layout, equal cards,…

5 min read
Lesson 15

CSS Grid Basics

Build two-dimensional layouts with CSS Grid: grid containers, columns and rows, the fr unit, repeat(), gap, and placing…

5 min read
Lesson 16

CSS Grid Layouts

Build full page layouts with grid-template-areas, make responsive card grids with auto-fit and minmax(), and combine Grid with…

5 min read
Lesson 18

CSS Transitions and Transforms

Animate changes smoothly with transition, move, scale and rotate elements with transform, choose easing, and add simple keyframe…

4 min read
Lesson 19

CSS Variables

Store colours, spacing and fonts in custom properties, use var() with fallbacks, build a dark mode, and organise…

4 min read
Lesson 20

CSS Project: Style Your Profile Page

Turn the plain HTML profile page into a modern, responsive design with variables, Flexbox, Grid, cards, a dark…

5 min read

JavaScript

25 lessons

The language that makes web pages interactive, from your first variable to working with the DOM.

Lesson 1

JavaScript Introduction

What JavaScript is, what it can do in the browser and beyond, how it relates to HTML and…

4 min read
Lesson 2

Where to Put JavaScript

Add JavaScript with script elements and external .js files, understand why placement matters, and load scripts correctly with…

4 min read
Lesson 3

JavaScript Output (console.log)

Show results with console.log and its relatives, write into the page with textContent, use alert sparingly, and debug…

4 min read
Lesson 5

JavaScript Data Types

Strings, numbers, booleans, undefined, null, objects and arrays; checking types with typeof; and how JavaScript converts between types.

4 min read
Lesson 6

JavaScript Operators

Arithmetic, assignment, comparison and logical operators, why to use === instead of ==, the ternary operator, and nullish…

4 min read
Lesson 7

JavaScript Strings

Create and combine strings, read characters, and use the essential string methods to search, slice, change case, trim,…

4 min read
Lesson 8

JavaScript Numbers

Work with numbers: rounding, fixed decimals, converting from strings, NaN checks, the Math object, random numbers and formatting…

4 min read
Lesson 9

JavaScript If/Else

Make decisions with if, else if and else, combine conditions, use truthy checks, write guard clauses and avoid…

4 min read
Lesson 10

JavaScript Switch

Choose between many exact values with switch, understand break and fall-through, use default, and know when an object…

3 min read
Lesson 11

JavaScript Loops (for, while)

Repeat code with for, while, do...while, for...of and for...in loops, control them with break and continue, and avoid…

4 min read
Lesson 12

JavaScript Arrays

Store ordered lists in arrays: create them, read and change items by index, add and remove with push,…

4 min read
Lesson 13

JavaScript Array Methods

Transform and search data with forEach, map, filter, find, some, every and reduce, and chain them together to…

5 min read
Lesson 14

JavaScript Objects

Group related data with objects: create them, read and update properties with dot and bracket notation, loop over…

4 min read
Lesson 15

JavaScript Functions

Write reusable code with functions: declarations, parameters and arguments, return values, default and rest parameters, and functions as…

4 min read
Lesson 16

JavaScript Arrow Functions

Write short functions with the arrow syntax, learn implicit returns and returning objects, and understand how arrow functions…

4 min read
Lesson 17

JavaScript Scope

Global, function and block scope explained, why let and const beat var, how shadowing works, and a first…

4 min read
Lesson 18

DOM: Selecting Elements

What the DOM is, and how to find elements with getElementById, querySelector and querySelectorAll, loop over results, and…

5 min read
Lesson 19

DOM: Changing Content

Change text, HTML, attributes, classes and styles, create and insert new elements, remove elements, and render a list…

5 min read
Lesson 20

JavaScript Events

Respond to clicks, typing and keys with addEventListener, use the event object, prevent default actions, and handle many…

5 min read
Lesson 21

JavaScript Forms and Validation

Read form values, handle submit, validate input with clear error messages, combine HTML validation with JavaScript, and use…

6 min read
Lesson 22

JavaScript Local Storage

Save data in the browser with localStorage and sessionStorage, store objects with JSON, handle errors, and remember a…

5 min read
Lesson 23

JavaScript Fetch and JSON

Load data from APIs with fetch, understand JSON and HTTP status codes, handle errors, send data with POST,…

5 min read
Lesson 24

JavaScript Async/Await

Understand asynchronous JavaScript, Promises and the event loop, then write clear async code with async/await, try/catch, and parallel…

5 min read
Lesson 25

JavaScript Project: To-Do List App

Build a complete to-do list app step by step with state, rendering, events, delegation, filters and localStorage, using…

7 min read

SQL

15 lessons

The language for storing and querying data in databases like MySQL and PostgreSQL.

Lesson 1

SQL Introduction

What databases and SQL are, why almost every app uses them, the main database systems, and how to…

4 min read
Lesson 2

SQL Databases and Tables

Create tables with CREATE TABLE, choose data types, understand primary keys and NULL, and load the practice shop…

5 min read
Lesson 3

SQL SELECT

Read data with SELECT: choose columns, avoid SELECT * in real code, rename columns with AS, calculate new…

3 min read
Lesson 4

SQL WHERE

Filter rows with WHERE using comparison operators, AND, OR and NOT, IN, BETWEEN, LIKE patterns and IS NULL,…

4 min read
Lesson 5

SQL ORDER BY

Sort query results with ORDER BY, ascending and descending, by several columns and by calculated values, handle NULLs,…

4 min read
Lesson 6

SQL INSERT

Add rows with INSERT INTO, list columns explicitly, insert several rows at once, use defaults and auto-generated ids,…

4 min read
Lesson 7

SQL UPDATE

Change existing rows with UPDATE and SET, always target rows with WHERE, update several columns and calculated values,…

4 min read
Lesson 8

SQL DELETE

Remove rows with DELETE safely, understand how foreign keys protect related data, compare DELETE, TRUNCATE and DROP, and…

4 min read
Lesson 9

SQL Functions (COUNT, SUM, AVG)

Summarise data with aggregate functions COUNT, SUM, AVG, MIN and MAX, understand how they treat NULL, and use…

4 min read
Lesson 10

SQL GROUP BY

Calculate totals per category, per customer and per month with GROUP BY, filter groups with HAVING, and understand…

4 min read
Lesson 11

SQL JOINs (INNER JOIN)

Combine rows from related tables with INNER JOIN, use table aliases, join three or four tables, and build…

5 min read
Lesson 12

SQL LEFT JOIN

Keep every row from the first table with LEFT JOIN, find rows without matches, count zero values correctly,…

5 min read
Lesson 13

SQL Constraints and Keys

Protect data quality with PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK and DEFAULT constraints, choose ON DELETE…

5 min read
Lesson 14

SQL Indexes

How indexes make queries fast, when to create them, composite indexes and column order, reading EXPLAIN plans, and…

5 min read
Lesson 15

SQL Project: Library Database

Design, build and query a complete library database with authors, books, members and loans, using tables, constraints, joins,…

7 min read

Python

20 lessons

A beginner-friendly language used for automation, data and AI.

Lesson 1

Python Introduction

What Python is, why it's the most popular first programming language, what people build with it, and your…

4 min read
Lesson 2

Installing Python

Install Python 3 on Windows, macOS or Linux, check it works, use the interactive shell, run your first…

5 min read
Lesson 3

Python Syntax

The basic grammar of Python: statements, indentation and blocks, comments and docstrings, long lines, naming rules and reading…

4 min read
Lesson 4

Python Variables

Create variables with assignment, understand that names refer to objects, assign several values at once, swap values, use…

4 min read
Lesson 5

Python Data Types

Python's built-in types (int, float, str, bool, None, list, tuple, dict and set), checking types, converting between them,…

4 min read
Lesson 6

Python Strings

Create strings, index and slice them, use the essential string methods, format text with f-strings, and loop over…

4 min read
Lesson 7

Python Numbers

Integers and floats, all arithmetic operators, rounding, the math and random modules, exact money calculations with Decimal, and…

4 min read
Lesson 8

Python Lists

Create, index, slice and change lists; add, remove, sort and search items; copy lists safely; and write list…

4 min read
Lesson 9

Python Tuples and Sets

Use tuples for fixed groups of values and unpacking, and sets for unique items, fast membership tests and…

4 min read
Lesson 10

Python Dictionaries

Store key-value data in dictionaries: read safely with get, add, update and delete keys, loop over items, nest…

5 min read
Lesson 11

Python If/Else

Make decisions with if, elif and else, combine conditions with and, or and not, use membership and identity…

5 min read
Lesson 12

Python Loops

Repeat code with for and while loops, use range, enumerate and zip, control loops with break, continue and…

4 min read
Lesson 13

Python Functions

Define functions with def, use parameters, return values, default and keyword arguments, *args and **kwargs, type hints, docstrings,…

5 min read
Lesson 14

Python Modules

Import modules, explore the standard library, write your own modules, understand if __name__ == "__main__", and organise code…

5 min read
Lesson 15

Python Files

Read and write text files safely with open() and with, process files line by line, append data, work…

5 min read
Lesson 16

Python Errors and Exceptions

Handle errors with try, except, else and finally, catch specific exceptions, raise your own, create custom exception classes,…

5 min read
Lesson 17

Python Classes and Objects

Object-oriented programming in Python: define classes, create objects, use __init__, attributes and methods, class attributes, special methods, properties,…

6 min read
Lesson 18

Python pip and Packages

Install third-party packages from PyPI with pip, isolate projects with virtual environments, record dependencies in requirements.txt, and choose…

4 min read
Lesson 19

Python JSON and APIs

Convert between Python and JSON, save and load JSON files, call web APIs with urllib and requests, send…

5 min read
Lesson 20

Python Project: Simple Expense Tracker

Build a command-line expense tracker step by step with a dataclass, functions, JSON storage, error handling, reports by…

6 min read

Java

12 lessons

Lesson 1

Java Introduction

What Java is, why it powers banks, Android and big companies, how the JDK, JRE and JVM fit…

4 min read
Lesson 3

Java Variables and Data Types

Declare variables, learn Java's eight primitive types, String, var, constants with final, type casting, integer overflow and naming…

4 min read
Lesson 4

Java Operators and Expressions

Arithmetic, assignment, comparison, logical, increment and ternary operators in Java, operator precedence, short-circuit evaluation and the Math class.

4 min read
Lesson 5

Java Strings

Create and use Strings in Java, the most useful String methods, why == fails and equals() works, the…

4 min read
Lesson 6

Java User Input with Scanner

Read numbers and text from the keyboard with Scanner, avoid the nextInt/nextLine trap, validate input, and print neat…

4 min read
Lesson 7

Java If, Else and Switch

Make decisions in Java with if, else if, else, nested conditions, the classic switch statement and the modern…

4 min read
Lesson 8

Java Loops

Repeat work with for, while, do-while and the enhanced for-each loop, control loops with break and continue, nested…

4 min read
Lesson 9

Java Arrays

Store many values in one variable with Java arrays, loop over them, find max and average, use 2D…

4 min read
Lesson 10

Java Methods

Write reusable Java methods with parameters and return values, understand pass-by-value, overload methods, use varargs and watch recursion…

4 min read
Lesson 11

Java ArrayList and Collections

Use ArrayList, LinkedList, HashSet and TreeSet, understand how an ArrayList grows, generics, wrapper classes, autoboxing, iterating safely and…

5 min read
Lesson 12

Java HashMap and Maps

Store key-value pairs with HashMap, LinkedHashMap and TreeMap, count frequencies with merge and getOrDefault, iterate entries, and see…

4 min read

DSA

29 lessons

Data structures and algorithms, one pattern at a time, with live animations you can play, pause and replay.

Lesson 1

DSA Introduction

What data structures and algorithms really are, why every big tech interview tests them, the 15 patterns that…

5 min read
Lesson 2

Big O Notation

Measure how an algorithm's work grows with input size. Learn O(1), O(log n), O(n), O(n log n), O(n²)…

5 min read
Lesson 3

Arrays and Strings

How arrays live in memory, why indexing is O(1) but inserting is O(n), linear search, in-place techniques, and…

5 min read
Lesson 4

Hashing: Hash Maps and Sets

The most useful tool in DSA. How hash maps and sets give O(1) lookups, and the patterns they…

5 min read
Lesson 5

Two Pointers

Solve sorted-array and pair problems in one pass with O(1) memory. Opposite-end pointers, slow and fast writer pointers,…

5 min read
Lesson 6

Sliding Window

Solve "best contiguous subarray or substring" problems in O(n). Fixed-size windows, growing and shrinking windows, and the template…

5 min read
Lesson 7

Prefix Sums

Precompute running totals once and answer any range sum in O(1). Then combine prefix sums with a hash…

4 min read
Lesson 9

Binary Search

Halve the search space every step for O(log n). The bug-free template, first and last positions, search insert…

5 min read
Lesson 10

Sorting Basics

Bubble, selection and insertion sort animated step by step, what stable sorting means, Python's built-in sort with custom…

5 min read
Lesson 11

Merge Sort and Quick Sort

The two classic O(n log n) sorting algorithms, animated. Divide and conquer, merging sorted halves, partitioning around a…

5 min read
Lesson 12

Recursion

Functions that call themselves, explained with a live call tree. Base cases, the call stack, the "trust the…

5 min read
Lesson 13

Backtracking

Explore every choice with choose, explore, un-choose. Subsets, permutations, combination sum, generate parentheses and word search, with a…

5 min read
Lesson 14

Linked Lists

Nodes connected by pointers. Build a linked list in Python, traverse, insert and delete, reverse it with three…

5 min read
Lesson 15

Fast and Slow Pointers

The tortoise and hare technique. Find the middle of a linked list, detect cycles and where they start,…

6 min read
Lesson 16

Stacks

Last in, first out. Use Python lists as stacks, match brackets (animated), build a min stack, evaluate expressions,…

5 min read
Lesson 17

Monotonic Stack

A stack kept in sorted order answers "next greater" and "previous smaller" questions in O(n). Daily temperatures, stock…

5 min read
Lesson 18

Queues and Deques

First in, first out. Use collections.deque for O(1) queues, build a queue from two stacks, process things in…

4 min read
Lesson 19

Binary Trees and Traversals

Nodes with left and right children. Build trees in Python, watch inorder, preorder, postorder and level-order traversals, and…

6 min read
Lesson 20

Binary Search Trees

Trees kept in sorted order. Search and insert in O(log n) (animated), validate a BST with bounds, find…

6 min read
Lesson 21

Heaps and Priority Queues

Always know the smallest item in O(1) and add or remove in O(log n). Python's heapq, max-heaps with…

5 min read
Lesson 22

Graphs: BFS and DFS

Model networks of friends, cities and web pages. Adjacency lists, breadth-first and depth-first search animated, connected components, shortest…

6 min read
Lesson 24

Topological Sort

Order tasks so every prerequisite comes first. Kahn's algorithm with in-degrees (animated), the DFS version, detecting impossible cyclic…

5 min read
Lesson 25

Shortest Paths (Dijkstra)

Find the cheapest route in a weighted graph. Dijkstra's algorithm with a heap (animated), why it needs non-negative…

6 min read
Lesson 26

Dynamic Programming (1D)

Dynamic programming without the fear. Remember answers instead of recomputing them. Memoization vs tabulation, climbing stairs and coin…

6 min read
Lesson 27

2D Dynamic Programming

DP tables with rows and columns. Unique paths in a grid, longest common subsequence animated cell by cell,…

6 min read
Lesson 28

Greedy Algorithms and Intervals

Make the best local choice and never look back. When greedy works (and when it fails), merging intervals…

6 min read
Lesson 29

The DSA Interview Playbook

Everything in one place. A pattern cheat sheet that maps problem clues to techniques, a 6-step method for…

5 min read

Interview Problems

51 lessons

Classic coding interview problems solved step by step: brute force first, then the optimal pattern, in Python.

Lesson 1

Two Sum

Find two numbers that add up to a target. The most famous interview warm-up, solved in one pass…

2 min read
Lesson 2

Contains Duplicate

Does any value appear twice? Three solutions from slow to fast, and why a set wins.

2 min read
Lesson 3

Valid Anagram

Are two words made of exactly the same letters? Count letters with a dictionary or Counter.

2 min read
Lesson 4

Group Anagrams

Put words with the same letters into groups. The trick is choosing a good dictionary key.

2 min read
Lesson 5

Top K Frequent Elements

Return the k most common numbers. Count with a dictionary, then pick the top k with a heap…

2 min read
Lesson 6

Product of Array Except Self

For every position, multiply everything except that number, without using division. Prefix and suffix products make it O(n).

2 min read
Lesson 7

Longest Consecutive Sequence

Find the longest run of consecutive numbers in an unsorted list in O(n), by only counting from the…

2 min read
Lesson 8

Valid Palindrome

Does a sentence read the same backwards, ignoring spaces and punctuation? Two pointers walking towards each other.

2 min read
Lesson 9

Container With Most Water

Pick two walls that hold the most water. Start wide and always move the shorter wall inwards.

2 min read
Lesson 10

3Sum

Find all unique triplets that sum to zero. Sort, fix one number, then run two pointers on the…

2 min read
Lesson 11

Trapping Rain Water

How much rain collects between bars of different heights? The water above each bar depends on the tallest…

2 min read
Lesson 14

Minimum Window Substring

Find the smallest part of a string that contains every letter of another string. Expand until valid, then…

2 min read
Lesson 15

Subarray Sum Equals K

Count continuous subarrays that add up to k, even with negative numbers. Prefix sums plus a hash map…

2 min read
Lesson 16

Maximum Subarray

Find the continuous part of a list with the biggest sum. Kadane's algorithm: keep going while the running…

2 min read
Lesson 17

Binary Search

Find a target in a sorted list in O(log n). The bug-free template, first and last position, and…

2 min read
Lesson 18

Search in Rotated Sorted Array

A sorted list was rotated at an unknown point. Binary search still works, because one half is always…

2 min read
Lesson 19

Koko Eating Bananas

Binary search on the answer. Find the slowest eating speed that still finishes all bananas in time.

2 min read
Lesson 20

Valid Parentheses

Are the brackets balanced and correctly nested? Push opening brackets on a stack; each closing bracket must match…

2 min read
Lesson 21

Min Stack

Design a stack that returns its minimum in O(1). Store the minimum-so-far alongside every item.

2 min read
Lesson 22

Daily Temperatures

How many days until a warmer day? A monotonic stack of waiting days answers it in one pass.

2 min read
Lesson 23

Largest Rectangle in Histogram

The biggest rectangle that fits under a bar chart. For each bar, find how far it can stretch…

2 min read
Lesson 24

Reverse Linked List

Flip the direction of every arrow in a linked list with three pointers. Iterative and recursive versions.

2 min read
Lesson 25

Merge Two Sorted Lists

Zip two sorted linked lists into one sorted list. The dummy node trick removes every special case.

2 min read
Lesson 26

Linked List Cycle

Does a linked list loop back on itself? A tortoise and a hare running at different speeds will…

2 min read
Lesson 27

LRU Cache

Design a cache that throws out the least recently used item when full, with O(1) get and put.…

3 min read
Lesson 28

Maximum Depth of Binary Tree

How many levels does a tree have? A three-line recursive answer, plus the level-by-level BFS version.

2 min read
Lesson 29

Invert Binary Tree

Mirror a binary tree by swapping every node's left and right children. Short, famous and a perfect recursion…

2 min read
Lesson 31

Validate Binary Search Tree

Is a tree a valid BST? Checking only parent and child is a trap; pass an allowed range…

2 min read
Lesson 33

Kth Largest Element in an Array

Find the k-th largest number without sorting everything. A min-heap of size k, plus quickselect for an average…

2 min read
Lesson 34

Merge k Sorted Lists

Merge many sorted linked lists into one. A min-heap always tells you which list has the next smallest…

2 min read
Lesson 35

Number of Islands

Count groups of connected land in a grid. Each time you step on new land, count it and…

2 min read
Lesson 36

Rotting Oranges

How many minutes until every orange rots? Multi-source BFS where each level of the queue is one minute.

2 min read
Lesson 37

Course Schedule

Can you finish every course given the prerequisites? Only if there's no cycle. Kahn's algorithm takes courses as…

2 min read
Lesson 38

Network Delay Time

How long until a signal reaches every computer? Dijkstra's shortest paths, then take the slowest arrival.

2 min read
Lesson 39

Word Ladder

Change one letter at a time to turn one word into another. Words are nodes, one-letter changes are…

2 min read
Lesson 40

Subsets

List every possible subset. For each item, choose "take it" or "skip it"; backtracking explores both.

2 min read
Lesson 41

Permutations

List every ordering of a set of numbers. Fill positions one by one with numbers not used yet,…

2 min read
Lesson 42

Combination Sum

Find every combination of numbers (reusable) that adds up to a target. Backtracking with a start index and…

2 min read
Lesson 43

Climbing Stairs

How many ways to climb n stairs taking 1 or 2 steps? The gentlest introduction to dynamic programming.

2 min read
Lesson 44

House Robber

Take the most money without robbing two neighbouring houses. At each house, choose "rob it" or "skip it",…

2 min read
Lesson 45

Coin Change

The fewest coins that make an amount. Why greedy fails, and how a DP table builds every amount…

2 min read
Lesson 46

Longest Increasing Subsequence

The longest rising sequence you can pick from a list (gaps allowed). An O(n²) DP, then a clever…

2 min read
Lesson 47

Longest Common Subsequence

The longest sequence of letters two strings share in order. The doorway into 2D dynamic programming, with an…

2 min read
Lesson 48

Edit Distance

The fewest insertions, deletions and replacements to turn one word into another. The algorithm behind spell-checkers and DNA…

2 min read
Lesson 49

Merge Intervals

Combine overlapping time ranges into one. Sort by start, then extend or start a new block in a…

2 min read
Lesson 50

Meeting Rooms II

How many meeting rooms do you need? Sort by start and keep a min-heap of end times, or…

2 min read
Lesson 51

Jump Game

Can you reach the last index if each number is your maximum jump? Track the farthest reachable point…

2 min read