tag:blogger.com,1999:blog-3902784927093335627.post561928844241361630..comments2024-01-13T10:30:52.324+00:00Comments on Between My Ears: Solving Causes' Levenshtein Distance challenge in 28 seconds. (Python)Anonymoushttp://www.blogger.com/profile/07772624197186878684noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-3902784927093335627.post-52333958784986004142012-01-05T09:02:03.959+00:002012-01-05T09:02:03.959+00:00I wouldn't have expected it to be :D
If you g...I wouldn't have expected it to be :D<br /><br />If you guys decide to publish the best solutions at some point, I'd love to have a peek.<br /><br />0.4s multithreaded C.. OMG. I'm guessing that's one long piece of code, though I could be wrong.Anonymoushttps://www.blogger.com/profile/07772624197186878684noreply@blogger.comtag:blogger.com,1999:blog-3902784927093335627.post-81375592547603787222012-01-04T19:17:35.231+00:002012-01-04T19:17:35.231+00:00Python will never be the fastest solution :) There...Python will never be the fastest solution :) There's a ~3.9s Java solution and a ~0.4s multithreaded C solution. It's possible that a Haskell or Prolog solution might come close to those two, but almost positively won't do better.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3902784927093335627.post-89330067939120752712012-01-04T11:03:44.954+00:002012-01-04T11:03:44.954+00:00Adam, cheers. That was really silly of me :). I wo...Adam, cheers. That was really silly of me :). I wonder if it will make it go faster. <br /><br />Is the record Python?Anonymoushttps://www.blogger.com/profile/07772624197186878684noreply@blogger.comtag:blogger.com,1999:blog-3902784927093335627.post-86744032135549918702012-01-04T08:31:10.090+00:002012-01-04T08:31:10.090+00:00You can use an implicit generator expression inste...You can use an implicit generator expression instead of an actual list comprehension:<br /><br />nf = set(j for i in cf for j in nextgen(i) if j not in f)<br /> <br />Pretty good solution though, about 15s on our benchmark machine. Record is 11.3s if you're up to the challenge :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3902784927093335627.post-78021917418769494162011-08-25T10:37:25.858+01:002011-08-25T10:37:25.858+01:00True, but 'causes' is a friend of 'cau...True, but 'causes' is a friend of 'cause', which is a friend of 'causes' so it is a friend's friend. I think this one is a definitional issue that Causes should have dealt with. Most solutions I've seen online included 'causes', so I did too. I have no opinion on the matter.Anonymoushttps://www.blogger.com/profile/07772624197186878684noreply@blogger.comtag:blogger.com,1999:blog-3902784927093335627.post-11944379919437207262011-08-25T04:29:40.018+01:002011-08-25T04:29:40.018+01:00Nitpick: I don't think the word 'causes...Nitpick: I don't think the word 'causes' itself is correct to include, the description says a distance of 'exactly 1' and d('causes','causes') = 0Anonymousnoreply@blogger.com