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.
I can explain. Unfortunately, quality checking on Codewars is poor, people can rate katas and raise issues, but it's up to the author's ability to understand what's wrong and their good will (which they may lack even if they clearly understand and know how to correct, having been politely informed – happened to me, so I don't want to do it anymore until the Codewars team come up with some improvement to the process (I do have some ideas) (but unlikely, as they have serious issues reported on GitHub and unsolved for almost 10 years, like the one that you can try to see your friend's or your own solution which definitely exists (as shown by Codewars elsewhere) but it's not there)). One of the most common problems is that tests test for too little (and often also too much) and allow much easier incorrect solutions to pass. (One of my ideas: allow others to write tests and earn honor points thereby, with some verification, e.g. by some supermajority of votes, perhaps weighted by voters' honor (a ninja could use proposed but yet unverified tests as an option, not required to pass the kata, but potentially useful).)
This isn't guaranteed to work. For
sort
to return a permutation of the elements to sort it's required (per https://tc39.es/ecma262/multipage/indexed-collections.html#consistent-comparator) for the passed function to be a consistent comparator. One of the conditions is that 0 must be returned when the same argument is passed in both position. With yours it's -1 whena
andb
are 0.This comment is hidden because it contains spoiler information about the solution
Yes, it works now, thanks!
By the way, the test suite (including basic and random) seems to always give strings starting with a letter to encode. From what I see in the solutions, some people assume it (as did I up to the moment I realized the desciption didn't guarantee it, so it's required to handle the other case too), some don't. I imagine you wouldn't like (or even be able to, depending on how Codewars works; I don't know, I haven't created any kata yet) to invalidate those solutions, so maybe add this condition to the description.
The random tests in Scala give data like this to
decode
:List( _ (cpofnp * (, cpaple 20 1000, )) LctesxpetnP, inpaetzy tyepr, pc zgpcqwzh )
. This is impossible – you can't get it fromencode
, the first 2 characters are always letters.Also, adding a sample test in which the data to encode doesn't start with a letter (but contains at least one, which is one of the many implicit conditions the kata description entails) would be prudent IMO.
Imagine me saying in my best attempt at a Vulcan voice: "It's adequate" 🖖
Please add an explanation, or at least an example in the desription or test cases, indicating what should be done when a letter is shifted out of its range. My interpretation is that Z shifted by 1 gives a. But I'm not sure, it isn't specified, and in case you meant A (i.e. independent rotation of the ASCII ranges A—Z and a—z), I'd only find out on attempting, after following a wrong path. This is a huge disadvantage for me, present in some katas, including this one. I hate it and tend to skip them. But I've seen your willingness to improve your katas, which are numerous, so I'm letting you know.
Unless the description states that something is to be found in the provided templates or tests, I think the template is just a suggestion, not a normative part of problem statement. How about replacing "your approximation of PI with 10 decimals" with "your approximation of PI with 10 or less decimals, without trailing zeroes"?
This comment is hidden because it contains spoiler information about the solution
@boandli is definitely onto something, I came here to report the same. The current problem statement requires
"all"
for 1 student, but the tests say otherwise. His post isn't labelled as an issue, so I'm raising it separately.Racket. The random tests tend to include e.g.:
"02|32|34, 00|17|20, 00|15|17, 00|16|16, 11|25|11, 01|26|37, 01|16|16,01|15|59, 02|32|34, 01|20|14, 02|32|34, 02|17|17, 01|16|30,01|15|59, 10|26|37, 01|17|48, 12|17|48, 01|47|16, 00|15|59, 01|17|20, 01|32|34"
.But there is! The separator between results isn't described, so has to be inferred from the example, where it's always
,
. But in one of the tests it's just,
.This comment is hidden because it contains spoiler information about the solution
Diameter a general notion in metric spaces. Although I concede that making cylinders an exception with a different definition giving smaller values may be popular in some presentations of spatial geometry in English. I wouldn't support it, however. It's easy to say "diameter of the base" for the other notion, but if you call that diameter, then it poses more difficulty to accurately capture the diameter in the metric sense.
Oh, only now do I realize it's you again who made this kata!
Well, thanks a lot for dealing with the issue promptly and adequately.
Loading more items...