Ad
  • Custom User Avatar

    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!

  • Custom User Avatar

    How does this work exactly? Could you explain it to me please?

  • Default User Avatar

    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..

  • Default User Avatar

    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?