kotlin-coding-challenges

Get duplicated arguments

Instructions

Given variable number of arguments (list of strings) checks whether there are any duplicates among the arguments and return list of all unique duplicates. If no arguments are passes return empty list.

Challenge Solution

Examples

getDuplicatedParams("a", "b", "c") //empty list

getDuplicatedParams("a", "b", "c", "a") // [a]

Hints

Hint 1 Use frequency counter or multiple pointers pattern.