Ad
  • Custom User Avatar

    Note that String.match returns null if there are no matches, which explains the first line of the message: the random string generated for the test case presumably doesn't contain one of the nucleotides. Since length is not defined for null objects, your variable countX remains undefined. Also note you are returning a string, whereas the description says you should be returning an object.

  • Custom User Avatar

    Lol, nice hack, thanks for spotting this.

  • Custom User Avatar

    Thanks for the comment!

    You're right, I've added a sentence to clarify your point just after item 3 in the description.

  • Custom User Avatar

    Just a minor comment on the wording, which is a bit unclear in places. For example, in the first section, I think it would be clearer to split the sentence over two lines like:

    Sue has hidden her word away in an array which includes:

    • letters - the letters that form the message
    • numbers - random numbers as well as not so random numbers

    It might also be worth specifying what kinds of inputs the user needs to worry about (i.e. do they need to handle empty/invalid inputs, duplicates, or will all your test cases specify correct inputs)