Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Thanks for the feedback. I have republished the kata with a fix.

  • Custom User Avatar

    Dfhwze... that's because I do keep learning and adjusting my opinions.

    Up until today I enjoyed codewars to the point where I tried to contribute with a kata.
    So far, the most annoying things were the random tests as I never had to deal with comments like yours on codewars.

    So, while I still maintain that the most of the random tests I experienced here were annoying (while accepting akar-0's point that they could be useful, and that they are required by the guidlines), thanks to you, I no longer find them the most annoying. Rude, unhelpful, and unnecessarily aggresive comments which you exposed me to definitely take the top spot. Congratulations.

  • Custom User Avatar

    That's great about 'Show Kata Test Cases' after solving. I haven't noticed this. I'll have a look at a few.

  • Custom User Avatar

    Thanks again, akar-0, do you have an example of well implemented random test (in any langauge). So far my experience was that I just get an error, sometimes with input values, but never with the expected correct value.

  • Custom User Avatar

    Thank you akar-0, that is a good reason, I'll try to implement some random tests.

    Dfhwze, what annoys me is not the 'correct ways' but rude and unhelpful comments from strangers.

  • Custom User Avatar

    Why? (And why an exclamation mark at the end? There really is no need to shout).

    I find the random tests to be the most annoying element of codewars.

    If we know the problem domain we can design tests to cover all inputs. This can be done, for example, using Boundary Value Analysis.

    Random tests don't guarantee to cover any useful test cases, and if they happen to fail, they don't offer any insight that would help to improve the code (as we don't get the input values or the expected result).

  • Custom User Avatar

    Could you include the random test input and expected data in the failed results?
    My solution passes in all specified tests and most random tests, but annoyingly there are always a few random tests where my calculation is off by 1 or 2. So far I was not able to replicate this issu.

  • Custom User Avatar

    Complexity of this solution is O(n^2) when the problem can be solved in O(n). Yet it appears to be considered 'clever'.

  • Custom User Avatar

    Isn't [320, 441] a buddy pair for 200 <= n <= 1000

  • Custom User Avatar

    There is no need to count totalDigit++; as it can be calculated using the provided formula (n * (n - 1)) / 2