containsDuplicate

Sorts array and checks if it contains at least one duplicate.

Template params: T = type of array element sort = true: do array.sort first; false: array is already sorted

bool
containsDuplicate
(
T
bool sort = true
)
(
T[] array
)

Parameters

array T[]

array to clean from duplicate values

Return Value

Type: bool

true if array contains a duplicate or false if not. Returns false if array is empty.

Meta