Ad
  • Custom User Avatar

    Thanks for your feedback. But I very much doubt that it can be solved in O(1). Because the answers grow with increasing values of relatively prime n and m. If you wanted to ask that there is a function that would use only standard arithmetic operations and return an answer, then I don’t know. If you look at the graph, it looks very chaotic. But you can learn more about this problem here https://oeis.org/A323472.

  • Custom User Avatar

    I like this very much! Kudos!

    But what does this have to do with combinatorics? Is there a O(1) solution ?

  • Custom User Avatar
  • Default User Avatar

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

  • Default User Avatar

    Hi @Voile - my apologies then, and sorry if I made you feel this way.

    Just to be clear, I personally have never asked anyone for justification of votes - for my own katas let alone other people's I don't even know - so maybe you're thinking of someone else (or you were referring to other people in general, in which case I agree with your opinion).

    My motivation in this case was simply that we have a first-time author who has made an interesting kata - as you surely know much better than I do, there are dozens of mediocre first-time beta katas on the site and I thought it's a good idea to "support" such promising kata authors by helping him navigate the opaque approval process.

    As you were the main commenter and seemed to have enjoyed solving it, I therefore thought you might enjoy the "updated" version, that's all.

    I can't comment on the rest of your reply as I'm newer to the site and its community and know (and care) even less about meaningless internet drama politics than you do; so once again, keeping it between us 2, my apologies for any misunderstanding and offense I caused you, and I won't do anything like that again.

  • Custom User Avatar

    Uh, I guess this means "no".

  • Custom User Avatar

    Strange, it was green before. Wonder how that got changed.

  • Custom User Avatar

    Please stop asking for others to make justifications for or reconsider their votes. First, nobody owes an explanation why they voted in any way; in fact, asking so constitutes a form of discrimination, because you cannot argue you'll only ask for it for abnormal votes; you're discriminating someone outside normalcy. Second, if everyone discussed before making votes, or even outright guessing other's votes, this is vote colluding/strategic voting and breaks the assumption that voting process is supposed to be anonymous (otherwise mods should just be allowed to see which user voted what).

    This is exactly one of the reasons why I do not want to interact with the community. I only browse CW to solve katas, point out obvious issues and make votes to the best of my judgement. I do not want to involved in any of this politics.

  • Default User Avatar

    When you have a N-dimensional array, you should use N indices if you want to get a value. For this case:
    return matrix[0][0]

  • Default User Avatar

    Hi @Voile, sorry to disturb - I'm just pinging to ask if you would consider revisiting your rating of this kata?

    Since you solved, I've helped author @SumZbrod update the tests. Now there are proper Random tests with good coverage, and the republished version has several improvements resolving all issues and suggestions.

    Thanks either way,

  • Default User Avatar

    Hey @dfhwze - I don't have the Green approve kata bar on my side :/

    So I'll leave a reply to @Voile 's most recent comment thread below and ask if he'd consider updating his rating - he's the only solver who has invalidated solution so I'm guessing he was the first solver during early beta, and maybe had mixed reviews based on the random tests back then.

  • Custom User Avatar

    seems approvable now

  • Default User Avatar

    Sorry for the extra message: just to say I edited the description slightly, as now we don't need to restrict n/m < 1/4.

    I also added the "Performance requirement" section instead, to state the range of the tests - if you want to edit the TESTS suite, then just remember to update the values in the description ;)

    Also, if the early reviewers don't return to change their "Somewhat Satisfied" votes, it might be necessary to reply to their early comments and ask them to revisit the kata - maybe in 48 hours or so, if there has been no change in the kata rating.

  • Default User Avatar

    Hi @SumZbrod - I have done the random tests for this kata; due to the size of them, I decided to edit your kata directly instead of post a huge code block in Discourse: I hope that you don't mind?

    If you now enter your kata editor you will be able to see the test layout - I hope it makes sense, I have used some clear variable names etc.

    I used my reference solution for the tests and, currently with the TESTS (see bottom of the random tests block), the entire test suite takes about 1.5 seconds to execute - this leaves the user 12 - 1.5 = 10.5 seconds to pass the kata which is acceptable.

    One small problem is that your solution didn't pass the updated tests, so I was forced to modify it just a very small bit (You are not allowed to Publish kata if your own solution does not pass tests). I have listed the (small) change to your solution in a separate post below this one - that way I can spoiler it so only people who have solved kata can see it!

    Hope that helps, I'll be on Codewars this evening if you need help with anything else.

  • Default User Avatar

    (Raising as Suggestion not Issue because working on it now):

    Random test layout can be improved - I will do this now and close my suggestion in ~1 hour or so.

  • Loading more items...