Ad
  • Custom User Avatar

    eval seems to be disabled in the full tests suite only, and that's not specified...

  • Default User Avatar

    I would suggst to specify in the description:

    • whether the solution should verify the second argument's validity (e.g. are parentheses balanced), and what it should return (or throw) when it's found invalid;
    • whether it is possible to search for the word "AND" (or "OR") and how this will be encoded;
    • whether multiple consecutive words -- that occur in the search argument without "AND" or "OR" between them -- should occur exactly like that in the text, i.e. in the same order, and with the same white-space character(s) between them.

    Test cases should be more extensive (as already commented), and should include test cases that test the cases mentioned above.

  • Custom User Avatar

    Operator precedence is unspecified.

    ( Standard JS, and possibly maths, is AND > OR. but you're free to specify right-to-left or whatever tickles your fancy. would be fun to do something different than usual actually. )

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Issues:

    • Needs random tests

    Suggestion:

    • Strongly suggest more edge case tests
    • Include tests with nested parens