Ad
  • Default User Avatar

    I think this is a great Kata. It's dealing with a baffeling and somewhat mysterious sequence. There is for sure a recursive solution to calculate the numbers. But it should be considered, that recursive solutions could be waaayyy too slow calculating higher numbers...

  • Default User Avatar

    This is kind of verbose!
    What regex is made for: to shorten such code.

  • Default User Avatar

    Yeah, me too, I definitely join the downvoters.
    But it's something like a valid solution.

  • Default User Avatar

    Oh, my, as I expectd, my brute force approach for JavaScript passed the first tests but timed out on the 'attempt'-tests. So I have to try something different... Maybe with a generator-function.

  • Default User Avatar
  • Default User Avatar

    In my C solution the test always says:
    Test Crashed Caught unexpected signal: 6
    Completed in 0.0000ms
    STDERR
    setup.c:46:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
    for (int i = 0; i < strlen(str); i++) {
    ~ ^ ~~~~~~~~~~~
    1 warning generated.
    munmap_chunk(): invalid pointer

    On my computer it runs perfectly, also with valgrind, I cannot find a memory leak.
    I checked the mallocs, but everything seems to be fine. Maybe I should increase/decrease the size of the allocated memory?

  • Default User Avatar

    For the C solution I'd definitely rank it as 6 kyu.