Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No, read what I copied/pasted there. If 1 is already in the expression then it can't be the unknown digit.
No, and it's been explained several times before.
The tests are ok. If you need to hardcode them, then your code is wrong.
1 supposed to work since 1 * 11 = 11
Some of the tests have wrong answers.
"?11=??" is 1 and not 2 since 1 < 2 and 111=11
the Tester is giving problems here.
For the sake of finishing the challenge
i am gonna hardcode the incorrect answers to
so the tester would accept them
This solution mutates the input, which could cause unexpected side-effects for the caller.
It looks like you're not using the Morse code dictionary provided with this kata, but are using one of your own. Stop it.
OK you're right
It is not actually brute force. It's O(n). Brute force here would be O(2^n) aka exponential.
And if you run your solution and his, you'll see, they both take around 50ms
Brute Force isn't very good, read on Dijkstra
This comment is hidden because it contains spoiler information about the solution