Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Thanks for the feedback. I have republished the kata with a fix.
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.
That's great about 'Show Kata Test Cases' after solving. I haven't noticed this. I'll have a look at a few.
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.
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.
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).
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.
Complexity of this solution is O(n^2) when the problem can be solved in O(n). Yet it appears to be considered 'clever'.
Isn't [320, 441] a buddy pair for 200 <= n <= 1000
There is no need to count totalDigit++; as it can be calculated using the provided formula (n * (n - 1)) / 2