Find All Duplicates

Find all elements that appear more than once in an array using frequency counting.

Code

Algorithms
echo "$arr" | jq 'group_by(.) | map(select(length > 1) | .[0])'

Parameters

Array to check (JSON)

Server

More Bash Snippets