Skip to content

Theory, a question and code — in one lesson

Short courses over the roadmap topics: read, answer one question, write code that runs right in the browser — Go, Python, C++ and JavaScript.

Free lessons are open to everyone; paid ones come with the subscription.

Theory

Slices: header, length, capacity

len and cap are not the same thing; append may reallocate the array.

Question

What happens on append to a slice whose cap == len?

  • Awritten into the same array
  • Ba new array; the old one is unchanged your answer, correct
  • Cpanic: out of range
Code

touching_intervals.go

func Merge(in []Interval) []Interval {
    sort.Slice(in, func(i, j int) bool {
        return in[i].L < in[j].L
    })
    // TODO: merge touching ones
}
Run tests
Go — slices in practicelesson 2 of 3 · progress saved

Three steps

  1. Pick a course by roadmap topic

    The badge in the catalogue says whether it is free or part of the subscription.

  2. Theory → one question → code

    The code runs right in the browser — nothing to install.

  3. Progress is saved

    Close the tab and come back to the same lesson from another device.

What people ask

What is free?
Free courses are open end to end. In paid ones the first lessons are a free teaser and the subscription opens the rest. The badge on the card tells you which is which.
Is progress saved?
Yes, in your account: close the tab and pick up the same lesson on another device.
Which languages run in the browser?
Go, Python, C++ and JavaScript. The code runs in your browser — nothing to install.
How do courses relate to the roadmap?
Courses follow the roadmap topics: the same order and the same topic names, lesson by lesson, with a question and code after the theory.

Start with a free course

A short track without a subscription: theory, one question and code that is checked by tests right in the browser.