Scrabble puzzle discussion

IN :
5
jxfhvw
ahzge
hqsvd
dgbc
agzev
jxdgbc

OUT:
dgbc

Thanks for your example. There is a small mistake : the last line must be 7 characters long.
After correction of the input, my algorithm finds dgbc but fails at “Valid word” final test.

1 Like

You should delete the following code instead correct my example. :’(

if(!(cin && line.size() == max_size))
	error("bad case");

Thanks a lot : I score 100%. What a relief !
That means that the “Valid word” final test doesn’t provide 7 letters as expected.

I hope this will help others.

6 Likes

strange, quantity of letters is really set to 7 in task description - but i did not rely on the length of LETTERS string in my solution so i avoided this problem

1 Like

Hi,

I would also be interested in this (the large dictionnary 1/2 fail on the submission, when similar tests pass in “manual”).

Regards

1 Like

My program passes all tests except for test 4. In the dictionary provided “waters” comes before “waster”. My program outputs “waters” but the test says “Expected: “was””. What am I missing/misunderstanding?
EDIT: I came up with a completely different way to solve the problem and it fails in the exact same way even though the approach is totally different. Fails test 4 before submission and fails the large dictionary 2 test after submission. Even when I work it out on paper I get ‘waters’ as the answer for test 4. If a moderator looks at my code they will only have to comment either line with “print firstAttempt” or “print secondAttempt” to see that my codes function. Any help would be appreciated.
EDIT 2: Found an error in my structure for holding scores for letters. Still fails test 4 but gets 100% after submission and that’s what counts I think.
EDIT 3: Just realized that it would be helpful to include the language I was using if I wanted the mods to check those tests. Python 2.7 or just Python on this site. Still no reply after 6 days. Wow. I’m impressed by what I shouldn’t be.

I’m doing this challenge in Python.
It works completely, all manual test pass.
But after submitting the “Value better than size” test fails!
I have no idea why, does anyone have a clue?

Thx in advance!

1 Like

“The only constraint is that the word must be made using the 7 letters which the player has drawn.”

No one ever said that you are not allowed to repeat letters. That should be specified in the statement, as it took me quite a while to figure that out with debugging.

Here is my tip. To gain some time (but not some space), sort the letters ! Insert them as below :
{“dorw” => “word”, “abit” => “bait”}
Then insert them in a tree. When you look for matches, you can perform a simple tree browsing instead of combining the letters in every single order possible.

Then you will successfully pass the last tests with big volumes of data.

I’m getting a weird issue. When I do the tests on the editor all of them pass. But when I submit large dictionary 2 fails.

1 Like

Maybe your answer is too slow.

I doubt it, It’s a fairly fast solution and it solved large dictionary 2 fine the first time.

Your solution works sometimes? That can happen. For example when the timelimit is 100ms and your solution takes 100ms ±10ms, depending on whether the garbage collector is running or not.

Same problem with last two tests in validation. Algorithm passes in less than 100 ms in IDE testing but fails on both of large dictionaries in validation, with no possibility to debug or get error message. Python2

1 Like

My solution succeed with all validators except “Valid word”.
Same validator in dev environment succeed.

Any idea what is specific with this validator and can help me find out what is wrong with my code?

For information, I used an algorithm in which I generate all combinations with the 7 given letters. Then I return the one scoring the best and having the first index in the given dictionary.

As it is ok with large dictionaries, it can not be a performance issue.
Thank you for your help.

I’m having the same issue and all the test cases pass and do it pretty fast, any way we could get the in for the Large Dictionary 2? Just so we can understand why only that test doesn’t work. Thanks

Ok Using Pyhon, I passed all validation tests. After submitting though, failing on 2 words with different value. I am not even sure what to troubleshoot. Does anyone has a clue on what the dataset is for this case.

Interesting. I have similar issue. I passed all test cases, but on submit 2 words with the same value fails. http://i.prntscr.com/76b2618dc4484b259196bffb397aafd9.png The code is written in Python3.

Ok, fixed that, the error was in the function that computes score of the word.