Skip to content

Instantly share code, notes, and snippets.

@JFFail
Created April 3, 2015 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JFFail/c286e62461d301d28c78 to your computer and use it in GitHub Desktop.
Save JFFail/c286e62461d301d28c78 to your computer and use it in GitHub Desktop.
Solution To Reddit Daily Programmer #208 - Culling Duplicate Numbers
#!/usr/bin/ruby
#Reddit Daily Programmer 208
#http://www.reddit.com/r/dailyprogrammer/comments/30ubcl/20150330_challenge_208_easy_culling_numbers/
puts "Enter your numbers."
print "> "
input = $stdin.gets.chomp
input_array = input.split(" ")
#Get the unique values.
uniques = input_array.uniq
puts uniques.join(" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment