Cloze

‹ The Blind 75 · Arrays

3Sum

Sort and two pointers · O(n²) time, O(1) extra space · LeetCode ↗

Find every different triplet of numbers in nums that adds up to zero, with no triplet listed twice.

Three trials

  1. 0 of 1 stars

    1 · Recall

    Fill single lines: a condition, an update, a return.

    Worth 10 XP

  2. 0 of 1 stars

    2 · Rebuild

    Rebuild a block, most often a loop body.

    Worth 20 XP

  3. 0 of 1 stars

    3 · Write

    Write the whole function body, with the tests as a net.

    Worth 40 XP