Ad
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar
    1. I based this translation off of the C one, and I thought that this would be the better choice. Thinking back, long long would have probably been a better idea.
    2. Due to the range being half negative and half positive numbers, about half of the tests could be passed by just returning 0. Though, thinking back, I think it would have been a better idea to generate 200 test cases: 100 with positive numbers and 100 with negative ones (and shuffle them beforehand).

    Will do both in a moment.

  • Custom User Avatar
  • Custom User Avatar

    Approved (though can't mark the suggestion as resolved)

  • Custom User Avatar

    Approved.

  • Custom User Avatar
    • Damn, you're right – thanks for noticing.
    • Eh, I don't think it's critical.
    • Oh, you're correct, it is exploitable indeed. When writing large test cases, it looks like I just copy-pasted the small test parts and forgot to modify them. I just assumed something about myself that I didn't do. It's not my code to begin with; I just did some cleaning πŸ˜…

    I think it should be good now. Please review it again.

  • Custom User Avatar

    Edit: Got approved.

    Made this fork in JS.
    Below is a representation of the average number of duplicates on 7 runs (700 tests). The indexes (0-99) are the number of duplicates for the test and the values are the number of time this number of duplicates was the solution.

    Let me know what I could improve !

    [
      0, 2, 1, 0, 1, 1, 1, 1, 1, 1,
      1, 1, 1, 2, 1, 1, 1, 0, 1, 2,
      1, 1, 2, 1, 1, 2, 1, 2, 0, 1,
      1, 1, 2, 1, 2, 1, 0, 2, 1, 1,
      1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
      1, 1, 0, 1, 1, 0, 1, 1, 0, 1,
      1, 2, 1, 1, 1, 1, 0, 0, 1, 1,
      1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
      1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
      1, 1, 1, 2, 1, 1, 1, 1, 1, 2
    ]
    
  • Custom User Avatar

    From what I can tell, none of the translations use fixed-length arrays or tuples, and none of the reference solutions make any assumptions of outer/inner array length. The phrasing in the description may be brief, but it is sufficiently language-agnostic and it is very clear what is being asked for.

    Regarding the test inputs all being 3x3, why not? The kata description makes no statements regarding input size other than the single example earthquake which is 3x3. Also, if a particular language's tests show the input upon failure (which they really should for a 7 kyu), having a smaller array will make it easier to debug your failing solution.

  • Custom User Avatar

    Would you please review this fork?

    I think it looks reasonable, but I know nothing about C#, I don't feel confident to approve it myself, and this kata is peculiar and particular in its testing.

  • Custom User Avatar

    OK thanks, saw that you authored a lot of katas...
    Moves the ref solution to the private section (learnt a thing there), also implemented the other ideas.
    Note: I'm not confortable (at all) with range v3 and fmt/... with C++17 clang (therefore pretty comfortable with c++20/23 stuff ) but with clang there is a hell of a lot of shi.. to include...
    You #4 is indeed nice !

  • Custom User Avatar

    That's an issue. Reraising as such.

  • Custom User Avatar

    Approved.

  • Custom User Avatar

    Forked and approved

  • Custom User Avatar

    Ayy, you're the first solver of the kata. Congrats!

    I'm glad that you liked it :)


    Side note: If you want to try more katas about TS types, you can take a look at this collection I made a couple months ago.

  • Loading more items...