atMost

inline fun atMost(n: Int, predicate: (Int) -> Boolean): Boolean(source)

Returns true if at most n elements in the list match the given predicate.

Return

true if at most n elements match the predicate, false otherwise.

Parameters

n

The maximum number of elements that may match the predicate.

predicate

A function that takes an element of type T and returns a Boolean.

Throws