Ad
  • Custom User Avatar

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

  • Custom User Avatar

    check the warnings generated by your code. also check this out:

    unsigned a = 5;
    int b = -1;
    printf("%u is %s than %d\n", a, (a > b) ? "greater" : "less", b);
    

    this is why you needed a cast.

  • Custom User Avatar

    По итогу крайне своеобразно нужно было использовать unsigned для N и там где было нужно кастить его обратно в инт. Странно, но задача бомба!

  • Custom User Avatar

    Немогу понять как так что на С проходит обычные тесты, а при прохождении тестов рандомных результат таких же тестов у меня на компьютере и на платформе совершенно разный.

  • Custom User Avatar

    Cool Kata, thanks. I had to read the description 3 times before I understood what was being asked. It wuold really help to provide an example of a 4 x 4 matrix as well.

  • Custom User Avatar

    All other languages have random tests, CS fixed here which is just a direct copy from JS with chai assertions (had to tweak down the input range to 50 to prevent buffer overflow still...) , closing ! ^^

  • Custom User Avatar

    Fixed in this fork

  • Custom User Avatar

    Fixed in this fork

  • Custom User Avatar

    Fixed in this fork

  • Custom User Avatar

    In Javascript, Node 18 is enabled, but tests don't use chai, causing a deprecation warning on test and attempt.

  • Custom User Avatar

    You are returning a numpy array, but the tests expect you to return a list of lists. They are different data-types and they work differently. The tests are basically comparing your return value to some expected value like this: your_answer == expected_answer, and if that expression results in True, you pass the test. When you compare two lists like list1 == list2, you get a single boolean such as True once the expression is evaluated. When you compare a numpy array with something like numpyArray == list, the result of that expression is another numpy array filled with booleans like this: [True, False, False]. The tests aren't expecting this, and that's what causes the error.

    So, you need to not return a numpy array.

  • Custom User Avatar

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

  • Custom User Avatar

    not so much guessing, but perhaps extrapolating or deducing...

    but anyway, if you've learned about numbers a bit, and you stare at the sample tests critically enough, the formula just leaps out at you

  • Custom User Avatar

    Never written a solver for this before, the answer is just obvious from the sample tests imo.

  • Custom User Avatar

    how is it a spiral even in the instructions?

  • Loading more items...