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.
Nice kata.
You do not need to delete my solution. After you add random tests, my solution will become invalid and will be hidden. You do not have to do anything.
In general, its not true that only problems with unlimited amount of possible results need random tests. Problems with finite amount of inputs can use at least random order of inputs, because otherwise tests can pass without actuall solving the problem: https://www.codewars.com/kata/reviews/66a2ba8bcfbe5c089a825b13/groups/66a3edc83fd3442e48346c58
Whether shuffling is needed for this simple problem can be argued, but it's a good practice in Codewars kata in general, it's easy, cheap, so why not. It's also mentioned in authoring guidelines. It would stop my wrong solution from passing.
The goal is to group all numbers adjacent in the list which differ at most by 1. In your example of
[-9, -8, -6]
, two last numbers do not differ by 1. If you have an idea for a better wording, feel free to suggest one.Looks like a duplicate of https://www.codewars.com/kata/513e08acc600c94f01000001
I've implemented these into the kata, hopefully it works much better. :D
(and yes, I did upvote my solutions :p)
Merged.
I reduced random input sizes in NASM to 52-bit numbers. NASM can handle about four 56-bit prime numbers. The probability of generating more than 4 large prime numbers is almost 0 but I decided to make the input sizes the same as in C.
Your solution seems to pass now?
Merged.
Hardens the tests against unexpected retur values.
Your solution is just buggy. It does not handle trailing whitespace correctly. It is not a kata issue.
What is your suggestion tho?
This solution is close to correct, but its last line with the
return
statement is wrong.This comment is hidden because it contains spoiler information about the solution
Loading more items...