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.
Missing empty strings and one-word string (no spaces) in sample && fixed tests of
CS
Crystal
C#
D
Elixir
Go (Only empty string test is missing)
Java
JS
PHP (Only one-word string test is missing)
Racket
Rust (Only empty string test is missing)
TS
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/196.
Please join the discussion to help us identify duplicate kata and retire them.
Input validation order is not specified; the description did not say the validation should be done in order, and by common sense value checks should not come before type checks.
How about this?
public class Solution { public static string[] StringToArray(string str) { return new string[0]; } } }
Test Failed
Expected is <System.String[1]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < <string.Empty> >
Test Failed
Expected is <System.String[6]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < "63C4PJK", <string.Empty>, "UG1"... >
Test Failed
Expected is <System.String[2]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < <string.Empty>, "NGPIQNZ3LDFZ46GQ" >
Test Failed
Expected is <System.String[3]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < "0DTFT", "91XM2ANRPN6OK0PB", <string.Empty> >
etc.
How can test wait for <string.Empty> if only non-empty strings are allowed in result array?
Some languages have random number of spaces between the words while others always use a single space. The JavaScript version which is very likely to be the original one uses the latter.
This comment is hidden because it contains spoiler information about the solution
Add test cases for words with in all lower case.
No random tests in Go
This comment is hidden because it contains spoiler information about the solution
Expected '#("Robin" "Singh"), but instead got '("Robin" "Singh")
what # mean? I has forget about racket,can someone help?
how can I return a form like '#("Robin" "Singh")?
This comment is hidden because it contains spoiler information about the solution
Description :
It is likely that this "We will take the relationship between Joules counted by the machine and the extra Calories burnt by the person to be a linear relation with the weight of that person." is stopping solutions.
This is a low level kata (programming wise) however a lot of novice programmers might not be able to deduce from that line alone how to relate the variables.
You might want to add something explicit like "every 100 kg then ..." otherwis this might be stuck at a low number of solutions.
This comment is hidden because it contains spoiler information about the solution
I suggest to put in the instructions that the tests are performed against perfect float point number equality or else I would implement a fixed error tolerance (
myVar.toFixed(margin)
).Indeed it wasn't too hard to solve the kata, I had to learn a lot about regex though.
The difficult part was dealing with having to go through strings such as
0.6666666e+10
, which I couldn't figure out why were giving me errors, until I realized I had to parse these strings and return an exact number in order to pass the test (by exact number I don't just mean a number, I mean the number expected by the test case with zero error tolerance).If the purpose of this is to add difficulty to the problem then I would state in the instructions that long floating numbers might appear (i.e.
1.232323232e+n
) and the test cases have a zero error tolerance, otherwise I think it's a nice kataIt would be good to add some additional condition that extra spaces between words should be removed. I.e., my solution, which was accepted, returns ['Abc', '', 'Xyz'] as an output for 'Abc Xyz', there are two spaces between.
Best
TI
Loading more items...