Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This was simply a challenge put out by a friend.

I tried to make this work in a couple of the languages I use most often (T-SQL, COBOL, and C#) but I was using a looping method that just was not very efficient. I tried to write something in PERL because I've used it to split files and for very minor file manipulation but again my approach was looping based. One of my friends suggested using a hash but my implementation of the hash was to find results using grep and then loop through.

Finally I realized that I couldn't come up with an appropriate solution and sought the wisdom of the experts and it has been a tremendous learning experience.

As for the use, this was simply an exercise to get the correct answer with the most efficient code. I was able to get the correct answer but my runtimes were longer than a day. One of my friends said he solved it with hashing and his program ran in 5 minutes.

I had the answer but wanted to see what the most efficient way of solving this problem.

Thank you for your participation!


In reply to Re^2: Words in Words by sarchasm
in thread Words in Words by sarchasm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found