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.
Can someone explain me how it works please?
it seems to be different related to other solutions!
Edit:
I think that just understand it! I give it a try and if i' ve mistaken something, correct me..
it takes the string, calling replace(regexp, replacerFunction) and for every character ("/./g") it's calling the fuction. Function just uses the string "CGAT" (contains all possible letters of DNA) and the string "GCTA" (contains the opposite of the 1st string!). The method "indexOf()" practically returns the opposite character we need.
Genious solution in my opinion and completely out of the box!
How does this work exactly? Could you explain it to me please?
No mistakes, probably, null inputs, no. Tests always generate a string for input.
thanks for answering akar-0.
So, i have to deal with null inputs and with inputs that have no "mistakes"(so the length will be zero). more studying is the solution i guess..
null
is not a string. And has notlength
. And no given string isnull
. That's the actual problem.I get this error at Random tests:
"TypeError: Cannot read property 'length' of null"
Someone with the same problem? I undestand that the given string is null, am i wright?