• ###### alexc19commented on "Next bigger number with the same digits" kata

If you are brute-forcing your way to the solution, it is very likely that you are timing out.

• ###### enchancecommented on "Finding the middle most prime number" kumite

@LucaREz This is much better. I like your explanation more than mine.

• ###### LucaREzcommented on "Finding the middle most prime number" kumite

You can't, you can fork it and fix it. Take a look at my fork and tell me if you like it

• ###### enchancecommented on "Finding the middle most prime number" kumite

How do I even delete this thing??

• ###### enchancecommented on "Finding the middle most prime number" kumite

A bit confusing. I'll just delete it and think of aother one. Thanks for the input.

• ###### LucaREzcommented on "Finding the middle most prime number" kumite

In the description you say 3 numbers but the solution you suggest is up to 3 not exactly 3,
then again you say in range 1 to 10 then you give an example with 12 as a selected number.
when you search for a non prime number in the is_prime function you can reduce the range in the for loop.
If the number you are checking is not prime the biggest factor that possibly divides that number is the one that pair with 2 to compose it, right? then your range could be `range(2, int // 2)` but then, after your first check you find that it is not divisible by 2, so the biggest factor that possibly divides that number is the one that pair with the next prime, 3. so `range(2, int // 3)` and so on.
Following the pattern you can actually stop at the square root of the number you are checking `range(2, (int)(math.sqrt(n))+1)`.
Since the maximum number obtainable is 101010, would you mind cache the 9674 prime numbers? If you have them cached (sorted) then you can binary search the closest prime and find the midmost one.

• ###### enchancecommented on "Next bigger number with the same digits" kata

This comment is hidden because it contains spoiler information about the solution

• ###### enchancecommented on "Next bigger number with the same digits" kata

I misread is as well until I took another look and saw that it's asking for the NEXT biggest number. Facepalm.

• ###### g964commented on "Directions Reduction" kata

Which language? What is wrong? Look at the top of the ppage to see how many people passed the kata.

• ###### enchancecommented on "Directions Reduction" kata

Something wrong with these tests. Good problem but the testing process is very flawed. I'm going to have to skip this one.