[Purdue-pm] challenge problem for next meeting?

Mark Senn mark at ecn.purdue.edu
Wed Jul 29 11:46:51 PDT 2015


Michael Gribskov wrote on 2015-07-29 at 13:14:41 -04:
|  It significantly changes the challenge if  you want the output to
|  inlclude only the (possibly) shortened forms that are unique to one
|  person.  In this case, there is no way to refer to Cat Stevens.  the
|  logic to identify that Cat must be maintained for Cat Stevens, and
|  further reductions of Cath must be rejected seems to be complex.  Is
|  this included in the challenge?
|  
|  I have a pretty straightforward way to solve this more complicated
|  problem, as well as a very simple ways to solve the problem as
|  originally stated in minimum time.

I'm only interested in the more complicated problem.  Sorry for the bad
problem description.  To summarize, read these names from a Perl data
section one name per line.
    Abe
    Alan
    Ben
    Cat
    Cathy
Do error checking to make sure there aren't duplicate names in the input.
Print the names under THESE NAMES one per line in your output.  Note that
the COULD REFER TO THESE PEOPLE column below is totally irrelevant to the
problem.  It was just added to better explain the problem.

    THESE NAMES    COULD REFER TO THESE PEOPLE
    -----------    --------------------------------------------------
    Ab Abe         Abe Lincoln
    Al Ala Alan    Alan Turing
    B Be Ben       Ben Carson
    Cat            Cat Stevens
    Cath Cathy     Cathy Rigby

    Cath is not shortened to Cat because we'd get Cat Stevens
    and Cathy Rigby confused.

Of course, your program should not just literally print
    Ab
    Abe
    [...]
The output should be dependent on the input data.    -mark
  


More information about the Purdue-pm mailing list