Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Words in Words

by aartist (Scribe)
on Oct 01, 2011 at 01:04 UTC ( #928973=note: print w/ replies, xml ) Need Help??


in reply to Words in Words

What is the purpose of this exercise? May be it is an XY problem and your needs can be fulfilled in a better way. Even if you find a way to do what you have asked, what you are going to do with the results? If we know before and after, we may direct you to a better version of answer.


Comment on Re: Words in Words
Re^2: Words in Words
by sarchasm (Acolyte) on Oct 02, 2011 at 20:40 UTC

    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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928973]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (16)
As of 2014-08-22 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls