Ad
  • Custom User Avatar

    It would also be more correct since pow returns a double, which gets imprecise at n = 94906269.

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Yes it was the problem, you had the same var name in both loops conditions RomperCondicion5 (or 3, can't remember and you've changed your code now), but you had different var names inside, RomperCondicion3 and RomperCondicion5. So, instead of exiting the loop, it was running until it timed out because the changes you made to one var didn't affect the other. Well, that's a good reason to keep your code dry (dry = don't repeat yourself). Read this please: https://docs.codewars.com/training/troubleshooting

  • Custom User Avatar

    no its not, the real problem was the a lot loops there is in my code. But my code pass all tests without any problem except the last. Because, one the test is a random test like a number of 5 figures when my code try to solve it, is when the time begins. But thanks i resolve it, i eliminate some innecesary lines and works now

  • Custom User Avatar

    You have a typo in your code and it has an infinite loop. Not a kata issue.

  • Custom User Avatar

    You can add it into collection --> read more info here

  • Custom User Avatar

    i have a problem, the page said me my code is very slow(12000ms) but when i test it on my pc its works fine like Tiempo de ejecuci├│n(execution time): 186 microsegundos(microseconds). I think its internets speed . Somebody Can affirm this ?

  • Custom User Avatar

    how i can save this kata¿

  • Custom User Avatar

    papaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa q grande eres ! como q 3 lineas de codigo mi hermanooooooooooooooooooooooooooo... felicidades.

  • Custom User Avatar

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

  • Custom User Avatar

    yes i understand! thanks.

  • Default User Avatar

    Write a function that will return

    the count of

    distinct case-insensitive alphabetic characters and numeric digits

    that occur more than once

    in the input string.

    In indivisibility the letter i occurs 6 times. It is the only letter that occurs more than once. So, the correct answer to this test is 1.

  • Custom User Avatar

    #include <criterion/criterion.h>
    #include <stddef.h>

    size_t duplicate_count(const char* text);

    Test(Sample_Cases, should_pass_these_three_tests) {
    cr_assert_eq(duplicate_count("abcde"), 0);
    cr_assert_eq(duplicate_count("abcdea"), 2);
    cr_assert_eq(duplicate_count("indivisibility"), 6);
    } these are the corrects tests , because in the original we have the second and the third one wrong , the letter i repeats 6 times but in the original say ONE ! ( i think this is wrong=)