Created
April 13, 2017 23:38
-
-
Save binford2k/3b22c4e7c237d2821c9ac0425e61558d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = [1,2,3,3,3,8,5,4,2,2,] | |
$dupes = $data.reduce |$memo, $value| { | |
if count($data, $value) > 1 { | |
[$memo, $value] | |
} | |
else { | |
[$memo] | |
} | |
} | |
notice($dupes.flatten.delete_undef_values.unique) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment