Logo

Programming-Idioms

History of Idiom 119 > diff from v54 to v55

Edit summary for version 55 by zr8c:
New Kotlin implementation by user [zr8c]

Version 54

2019-09-26, 18:46:27

Version 55

2019-09-26, 18:59:42

Idiom #119 Deduplicate list

Remove duplicates from list x.
Explain if original order is preserved.

Illustration

Idiom #119 Deduplicate list

Remove duplicates from list x.
Explain if original order is preserved.

Illustration
Extra Keywords
deduplicate dupe dupes redundant redundancy undupe
Extra Keywords
deduplicate dupe dupes redundant redundancy undupe
Code
val duplicates = listOf("one", "two", "two", "one", "three")
val noDuplicates = duplicates.toSet()