Word Lazy Swap

Discuss about the puzzles, but without giving the solutions please !!!

Word Lazy Swap

Postby admin » Wed Jan 05, 2011 8:55 am

Given a dictionary and two words of equal length that are in the dictionary, find the length of the shortest sequence of transformations required to rewrite the first word into the second one. Each word in the sequence must belong to the dictionary and must differ from the previous word by only one letter.


Last edited by admin on Fri Jan 14, 2011 7:38 pm, edited 2 times in total.
Reason: Edit
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Word Lazy Swap

Postby Francesco Laurita » Thu Oct 20, 2011 8:54 am

Hi Admin!

Could you check my last submission for this puzzle?
My solution pass every test except for the first one. Is there some dirty/tricky input?

Thanks in advance!
User avatar
Francesco Laurita
 
Posts: 7
Joined: Tue Feb 08, 2011 12:34 pm

Re: Word Lazy Swap

Postby admin » Fri Oct 21, 2011 12:07 am

I checked your latest submission for this puzzle, and the cause of failure for the first test case is CPU exceeded. There's no special tricks, only 100 small test cases (e.g. short paths), it looks like the number of test cases greatly influences your solution runtime regardless of the length of the paths.
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Word Lazy Swap

Postby Francesco Laurita » Mon Oct 24, 2011 10:17 am

Yeah I see!
At the least I got my solution accepted even if with a very low score. It looks like I'm missing some kind of pruning.

Thanks!
User avatar
Francesco Laurita
 
Posts: 7
Joined: Tue Feb 08, 2011 12:34 pm

Re: Word Lazy Swap

Postby bknarendra » Fri Dec 16, 2011 8:52 am

Hey admin can you look at my submission
http://codercharts.com/submission/43108
How is it possible that it passes the hard test cases and not the easy ones
According to me it is correct but don't understand why it fails. Any kind of clue would help.
Does it fail because of memory overuse or some other reason. Plzzzzzz help.
User avatar
bknarendra
 
Posts: 4
Joined: Thu Sep 22, 2011 6:30 pm


Return to Puzzles

Who is online

Users browsing this forum: No registered users and 2 guests

cron