Created
May 2, 2018 12:10
-
-
Save keisukeYamagishi/75a91575124f32f83778d5d67d9109aa to your computer and use it in GitHub Desktop.
This file contains 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
def dupli (d) | |
uniqDups = d.uniq | |
dups = Array.new | |
uniqDups.each { |e| | |
if d.grep(e).size > 1 | |
dups.push(e) | |
end | |
} | |
return dups | |
end | |
dup = 'aaabbbcccccccccdddde' | |
p dupli(dup.split("")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment