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.
the solution is displayed as best pratices but DRY (LCM(x, y) is calculated twice)
Nice!!
Same bro
i see so i have to find a different approach thats quicker
got it tysm
When there is no next smaller number (the expected return value is -1), your solution has to check every number in your range. For the seventh sample test, that means it has to check 23456788 numbers before it returns -1. While this one sample case may be possible in under 12 seconds, you only have 12 seconds to complete all of the tests. When there is a possible next smaller number, your solution doesn't have to check nearly as many numbers, so it seems fast enough. You will have to come up with a more efficient solution. There is a method to figuring out the next smaller number, you don't have to try 10 million different numbers to find the correct one.
This comment is hidden because it contains spoiler information about the solution
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']
]
Not bad)
From the description:
Loading more items...