Skip to content

Given a list of words (words.txt), generate two output files, 'questions' and 'answers'.

Notifications You must be signed in to change notification settings

davingee/Questions---Anwsers

Repository files navigation

ruby question_answer.rb

ruby -rprofile question_answer.rb


Given a list of words (words.txt), generate two output
files, 'questions' and 'answers'.  'questions' should contain every
sequence of four letters that appears in exactly one word of the
dictionary, one sequence per line.  'answers' should contain the
corresponding words that contain the sequences, in the same order,
again one per line.

An example:

Say this is your dictionary:
arrows
carrots
give
me

'questions' would contain:
carr
give
rots
rows
rrot
rrow 

and 'answers' would have:
carrots
give
carrots
arrows
carrots
arrows
 
'arro' wouldn't show up in 'questions', because it appears in two words

About

Given a list of words (words.txt), generate two output files, 'questions' and 'answers'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages