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.
Excuse me! I want to delete the first my comment (but there is no such possibility on the site). I could not determine the algorithm for determining the secret word. And it was not possible for me to learn this algorithm. My opinion is that it would be easier if there were two tests in the task definition, simple and difficult (or medium).
Why not? How do you think this kata has been solved more than 17k times and nobody complained about that test?
"mathisfun" has no repeated letters.
With the input given you can recover "mathisfun". Seriously, I don't know what you meant there.
the test for 'whatisup' and the description of the problem condition are absolutely not suitable for the secret 'mathisfun'!!!
There is no such test, and mind your language.
Please read the description again, ['c','b','a'] is not a valid triplet for the string "abc":
This comment is hidden because it contains spoiler information about the solution
try:
secret441 = "abc"
triplets441 = [
['c','b','a'],
['a','b','c']
]
To think my thought process of finding the first character was the same, but couldn't figure out how to continue for the next characters.
And then to see this 'simple' solution to the problem...
Hats of to you
Thank you for the explanation. 5 years later it is still providing value!
Thanks. It's really not a big deal, I overengineer sometimes too. I think the wording in Kata prompt certain approaches -- like the graph approach. I try to find novel approaches and this one struck me when I was thinking about properties of triplets.
Nice, I really over engineered my version (polite way of putting it). This is clean and simple - no idea where my mind went!
not clean or maintainable by other team members. clever to cram everything together and i also think the big O performance of this solution will be terrible
Thanks for the explanation. I think I learned more on this kata than any other on the site despite my solution being ridiculously long.
nice solution
Keep in mind that this kata is not tagged as a performance kata. It is not calling for code to be tuned/optimized. This solution runs more than fast enough to finish within the 12 seconds that codewars allows.
Had this been an actual performance kata, I would have tuned my approach until it finished the test cases in the allowed time.
I suggest creating a performance variant of this kata if you're interested in taking it there. The problem sizes for this kata is currently limited to 26 letters. You'd want to mark the new kata with a performance tag and test and include tests that would keep naive or unoptimized solutions from finishing within Codewars' 12 second limit.
Loading more items...