Ad
  • Custom User Avatar

    Excellent kata, I enjoyed learning about determinants and solving this. Took me too long to realise I wasn't multiplying the sub determinant by the anchor for 4x4 + matrices.

  • Custom User Avatar

    You can technically do what you're trying to do without division; your intention is to cancel out numbers, and you can either do that by division as you're doing, or by multiplication (hint: maybe std::lcm can help?). Haven't tried it out, but you should probably be able to find an approach that works without float division.

  • Custom User Avatar

    Don't think that way. You'll get quicker the more higher rank Katas you solve. The fact that you solved it now means you'll solve similar Katas much quicker. That's how it works for everyone; people program quickly when they've seen enough problems of that sort.

  • Custom User Avatar

    How long should it take to solve this Kata?
    It took me 5 hours, is it too long?

  • Custom User Avatar

    When using a faster approach that requires working with floating point numbers, the results on large matrices are either off by 1, or miss completely. How can I fix that?

  • Default User Avatar
  • Custom User Avatar

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

  • Default User Avatar

    Fun kata! But I have a question why in C# all kata seems to uses jagged arrays instead of multidimensional? (int[][] this instead of int[,]). I am genuinely curious because it seems to me more appropriate a multidimensional array in this case and in many others that I found... am I wrong?

  • Custom User Avatar

    Answered, closing.

  • Custom User Avatar

    I don't think so, except if my code and the tests are bugged the same way :)

  • Default User Avatar

    this comment made my day

  • Default User Avatar

    Thanks, you are right, my solution was incorrectly finding submatrix <3

  • Custom User Avatar

    Your main function is recursive, so what you print is not what tests pass to you - you print also intermediate matrices of your calculations, and the intermediate matrices become invalid at some point.

    The bug is somewhere in your solution, I checked the tests and they do not create inputs with "holes". These come from your solution.

  • Default User Avatar

    In JS after 8 normal tests I'm getting matrices like:

    [ <1 empty item>, [ 4, -2, 5 ], [ 2, 8, 7 ] ] (expected result - 0)

    [ [ 6, 1, 1 ], <1 empty item>, [ 2, 8, 7 ] ] (also 0)

    [ [ 6, 1, 1 ], [ 4, -2, 5 ] ] (here expected result is.. -306)

    Is it supposed to be so? In instructions: "Write a function that accepts a square matrix (N x N 2D array)"

  • Default User Avatar

    Should probably make it clear that the matrix is being represented by row vectors (alternative would be column vector). One can assume that and infer that from the examples but it really is the kind of info that should be in the instructions.

  • Loading more items...