Lesson 15: Caterpillar method

The method checks the elements in a way that’s reminiscent of the movements of a caterpillar.

Open reading material (PDF)

AbsDistinct

Compute number of distinct absolute values of sorted array elements.

Difficulty Level: Easy

CountDistinctSlices

Count the number of distinct slices (containing only unique numbers).

Difficulty Level: Easy

CountTriangles

Count the number of triangles that can be built from a given set of edges.

Difficulty Level: Easy

MinAbsSumOfTwo

Find the minimal absolute value of a sum of two elements.

Difficulty Level: Medium