The method checks the elements in a way that’s reminiscent of the movements of a caterpillar.
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