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.
No it doesn't --> it's more efficient because it starts with largest string possible and works to smaller strings as necessary if a match is not found.
Duplicate. Closing.
You can have a print satement in the begining of your function with all your input data
This comment is hidden because it contains spoiler information about the solution
I don't know which language this is, so I might be wrong - because it's a bit subtle.
In the last "for" loop, when the code calls sentence.replace(), no position is specified. So if "aux " appears near a noun phrase, the code might replace the first "aux " in the sentence - not at the desired location. That's why I think the initial "aux " is disappearing.
It also explains why this triggers on random tests: there's more repeated words, which makes the chance of matching the same word in two locations higher.
You didn't provide your code or even the language you had problems with, so... You're welcome.
I had to guess it was Javascript and the kata is solvable there, if you're talking about lack of sample tests, then it's been already reported, and it's up to the kata creator.
There is nothing smart there. It goes through every possible substring just like every other solution does. There is no way around there. It just does it in reverse.
That was actually my first thought when making my answer to this kata. Until halfway through I realized that I wasn't accounting for duplicates which happened to add up to 45 in the end.
This comment is hidden because it contains spoiler information about the solution
I made this mistake as well- if you create a class you can't assume an instance of it will be set up. I used static functions as a quick fix.
I agree with you, though you're kind of cheating yourself. And this is not a judgement because I use to cheat myself too. It's not our fault if the tests are weak. I think cheating is ok when you know you could do differently if necessary.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That's an issue.
That's a problem with your code, not a kata issue.
Loading more items...