Skip to content

Instantly share code, notes, and snippets.

@keisukeYamagishi
Created May 2, 2018 12:10
Show Gist options
  • Save keisukeYamagishi/75a91575124f32f83778d5d67d9109aa to your computer and use it in GitHub Desktop.
Save keisukeYamagishi/75a91575124f32f83778d5d67d9109aa to your computer and use it in GitHub Desktop.
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