Ad
  • Default User Avatar

    Problems like these have nothing to do with coding skills. If you know the algo, you can do it, otherwise you'll keep staring at it for a week and still get nowhere.

  • Custom User Avatar

    Test Failed
    It should work with random inputs too
    Expected and actual are both Values differ at index [62]
    Expected: 15844851111166432.0d
    But was: 15844851111166428.0d

    //I Just refresh the browser and submit again and it works, what am I missing here? sometimes the code is working, sometimes not? weird. Thanks for future response

  • Default User Avatar

    Dies of cringe

  • Custom User Avatar

    This didn't work out for me, I don't know why so I have unlocked the solution.

  • Custom User Avatar

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

  • Custom User Avatar

    it's most of what it takes to be a good coder for sure

  • Custom User Avatar
  • Custom User Avatar

    I might be a bit late here, but here it is:

    since the function is given as:
    Data* sqInRect(int lng, int wdth) {};

    you must return a pointer to the struct. You have two options.

    initialize with a pointer:

    Data *output;
    ...
    return data;

    or return the pointer to your struct.

    Data output;
    return &data;

  • Custom User Avatar
  • Custom User Avatar

    What language you're using? if C then you should mind the return type.
    In this case the return type is size_t
    Use calloc bro this was my error too. I'm using C.

    BTW if you see this, would you not mind if you already finished g964 Kata's the:
    Rectangle into Squares and Backwards Read Primes

    I believe I know how to solve it but I don't know how to return the value. I've rewritten it without using typedef struct and I manage to have correct answers. But in the format typedef struct in those katas I'm getting error: Caught unexpected signal: 6

  • Custom User Avatar

    Good day! I can't solve it the reason is I don't know how typedef struct Data works I don't know how to return the value without error, could you please help me. It passes first test but then next cases are not. I'm using C lang It always say

    Caught unexpected signal: 6

    By the way I've rewritten the code by not using typedef struct so that I'll know if my codes are in fault but it passes all the sample tests. Thanks in advance!

  • Custom User Avatar

    !!!Watch out buddies for this!!! Pretty bit confusing. The example shows that the result are double array but in the problem itself it's just a simple array.

  • Custom User Avatar

    Too clever to find out that, mutating the input. haha nice!

  • Custom User Avatar

    I am confused as well at first.
    Assuming you already know the instruction for i,d,s now let's proceed to the returning of the result.
    There is no fix array length for result because array index is incrementing every 'o' So for instance:

    string input = "iioio"
    int result[] = {2, 3};

    string input = "iodoio"
    int result[] = {1, 0, 1};

    I hope you understand bro!

  • Custom User Avatar

    Could you please help me. I'm using C and I don't know how to return the answer. Thank you in advance!

  • Loading more items...