/*****************************************************************************/
/* ___ _ */
/* / _ \ _ _ __ _ _ _ __ _ ___ _ _ ___| |_ ___ */
/* | (_) | '_/ _` | ' \/ _` / -_) '_/ _ \ _(_-< */
/* \___/|_| \__,_|_||_\__, \___|_| \___/\__/__/ */
/* |___/ */
/* ___ _ ___ */
/* | \ __ _| |_ __ _ | \ _ _ _ __ _ __ */
/* | |) / _` | _/ _` | | |) | || | ' \| '_ \ */
/* |___/\__,_|\__\__,_| |___/ \_,_|_|_|_| .__/ */
/* |_| */
/*****************************************************************************/
| + /index.html + /article + /archive + https://source.orangerot.dev/ |
'-----------------------------------------------------------------------------`
Note: Keywords might give ideas in which direction to think, but might lead to a
false path.
Dedup pairs
Given an unordered array of numbers, that occur any of 1..arr.len times in the
array, output those numbers, so that they occur at most two times but not higher
than in the input.
Keywords: HashMap, Dedup, Window
Example:
input: [1, 2, 2, 2, 4, 5, 5]
output: [1, 2, 2, 4, 5, 5]
Copyright 2024-2025 orangerot