Page 1 of 1

Problem 042

Posted: Wed Mar 23, 2011 2:15 am
by Traverse
Hello, all.

Is it possible something has changed with the text file for problem Problem 42 (View Problem)? To clarify, 42 involves finding the number of so-called "triangle words" in a text file of common English words. I'm relatively confident in my algorithm (problem is pretty straight-forward), but I keep coming up with the same number, which comes back wrong. Also, the text file is reported to have nearly 2000 words, whereas the file I downloaded only had 1786. "Nearly 2000" seems a little generous, so I'm wondering if something has changed with the file. Believe me, I've tested a lot of other possibilities before questioning the text file.

Maybe I'm just screwed w/r to this one?

Re: Problem 42

Posted: Wed Mar 23, 2011 3:43 am
by TripleM
1786 is correct, as is the text file and the accepted answer :)

Re: Problem 042

Posted: Wed Mar 23, 2011 10:16 am
by Traverse
Dang.

Re: Problem 042

Posted: Wed Mar 23, 2011 11:40 am
by Traverse
Just figured it out. Cheers!

Re: Problem 042

Posted: Mon Apr 11, 2011 4:39 am
by cdd
i keep getting 77 which is incorrect. Can someone let me know if this is close, so i can see if my algorithm is working at all.

Re: Problem 042

Posted: Tue Apr 12, 2011 1:54 am
by rayfil
@cdd
I would suggest that you scrap your existing algo and restart totally from scratch in a few days after you have forgotten how you tried to solve it in the first place.

Take a good look at the given example and make sure you understand it. Look at the word.txt file with Notepad or any other text editor and understand its structure so that you can parse it correctly with your algo.

Re: Problem 042

Posted: Tue Apr 12, 2011 2:23 am
by cdd
thanks for the reply. Im pretty sure my algorithm is correct but could PM you my code for you to take a look at just to make sure?

Re: Problem 042

Posted: Tue Apr 12, 2011 4:29 am
by cdd
nvm figured it out, i forgot that vectors start at the 0th index not 1. :oops:

Re: Problem 042

Posted: Wed Oct 19, 2011 5:49 pm
by tomalmy
Anybody doing this had ought to do problem 22 first. They are closely related.