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.
Fixed (should be upgraded to Ruby 3 and RSpec anyway), but I'll retire the kata anyway.
I'll retire the kata. It's old and has been superceded by this.
This is a confusing kata. There are no provided tests in JS and the provided comment and function header don't match the instructions. The submission tests pass in values that aren't numbers without that having been explained in the instructions. I was able to pass by hardcoding the solution, so there are insufficient random tests.
After fixing these issues, I'm still not sure the concept leaves much interest or originality. There are many other map/sort kata.
Sorry, I don't really follow--in the other kata, more than one pair can be the solution. In yours, the return value requires slightly more specific bookkeeping, but that's immaterial to the main algorithm--summing the indices is a superficial difference.
This comment is hidden because it contains spoiler information about the solution
This was marked as resolved, but the name is still
camelCase
.Actually, the adjustments throughout the thread appear to only have been applied to submission tests, not sample tests, which still use 6969 as a flag for "not found".
Returning -1 isn't great, either, since there's no reason the algorithm shouldn't work on negative numbers. Better to raise or return None.
It seems unusual/impractical to return a list of strings delimited by dashes. Normally, I'd expect the function to return a 2d list of numbers so it's maximally usable by the caller. If the caller wants to join it for display purposes, that's up to them.
The description doesn't say anything about returning
null
for empty arrays. This is only discoverable by submitting.I'm not sure what this means:
Is someone removing tags from this challenge? I've tagged it multiple times with 'algorithms' and 'strings', which appear to be appropriate (if not, please tag them with something else rather than removing the tags entirely), yet after a day or two it shows back up in the untagged kata list.
Those aren't filtering objects by a property as in this kata. I'm 97% sure I've seen a JS object filter challenge somewhere though...
This does seem likely to be a dupe but I wasn't able to find anything obvious after poking around for a minute. If we can find a concrete dupe, that should bring some clarity to the discussion here.
ReferenceError: test is not defined
in the sample test. You can use the working submission tests to write the sample.Missing random tests.
Typo: "opperations" should be "operations". Usually functions have verb names, so I suggest using
perform_operation
or similar.The test labels don't match the tests:
"Random tests" should be "Fixed tests" or "Basic tests".
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...