My algo in short is this: hash all words into hash-table, for each word generate all possible edit-steps and check hash-table to see if it exists. Build a graph and do DFS. Im sorry the code's huge. :oops:
I don't think that DFS is required to solve this problem. My accepted program is very ...
Search found 6 matches
- Thu Feb 08, 2007 6:55 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10029 - Edit Step Ladders
- Replies: 70
- Views: 33438
- Sat Feb 03, 2007 9:56 pm
- Forum: Volume 7 (700-799)
- Topic: 705 - Slash Maze
- Replies: 13
- Views: 12856
Man.. I had a stupid mistake. I was printing ":" after k Cycles instead of ';'. I was somehow getting wrong answer rather than presentation error. I guess it's because of the lack of a blank line after the last case. When I changed ':' to ';' in my output, I got presentation error. And putting a ...
- Sun Nov 26, 2006 1:49 am
- Forum: Volume 101 (10100-10199)
- Topic: 10132 - File Fragmentation
- Replies: 24
- Views: 15836
- Sat Nov 18, 2006 3:32 am
- Forum: Volume 100 (10000-10099)
- Topic: 10055 - Hashmat the Brave Warrior
- Replies: 166
- Views: 77164
- Thu Nov 16, 2006 8:29 pm
- Forum: Volume 2 (200-299)
- Topic: 272 - TEX Quotes
- Replies: 136
- Views: 56426
- Fri Nov 10, 2006 9:38 pm
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 79288
Try the following input:
64 open brackets and 64 close brackets.
I think the answer should be Yes, since the maximum string length is 128 according to the description.
Code: Select all
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
I think the answer should be Yes, since the maximum string length is 128 according to the description.