Skip to content

Commit

Permalink
Use set
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfone committed Jan 23, 2014
1 parent f320a7d commit fef0cfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/*
3 changes: 2 additions & 1 deletion level0
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env ruby
require 'set'

# Our test cases will always use the same dictionary file (with SHA1
# 6b898d7c48630be05b72b3ae07c5be6617f90d8e). Running `test/harness`
# will automatically download this dictionary for you if you don't
# have it already.

path = ARGV.length > 0 ? ARGV[0] : '/usr/share/dict/words'
entries = File.read(path).split("\n")
entries = File.read(path).split("\n").to_set

contents = $stdin.read
output = contents.gsub(/[^ \n]+/) do |word|
Expand Down

0 comments on commit fef0cfc

Please sign in to comment.