Ad
  • Default User Avatar

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

  • Custom User Avatar

    Maybe markup messed up in your comment?

    The real tests look like this:

          doc1 = "More (XXXXX) to muck up reg.*{99} [solutions]+";
          doc2 = "More (stuff) to muck up reg.*{99} [solutions]+";
          assertTrue(test(doc1,doc2));
          
          doc1 = "More (XXXXX) to muck up reg.*{99} [solutions]+";
          doc2 = "More (stuff) to muck up regZ*{99} [solutions]+";
          assertFalse(test(doc1,doc2));
    
          doc1 = "More ^XXXXX) to muck up reg.*{99} [solutions]+";
          doc2 = "More ^stuff) to muck up reg.*{99} [solutions]+";
          assertTrue(test(doc1,doc2));
    
  • Custom User Avatar

    spoiler flag... ;p

    no, not efficient enough: you need a solution with O(1) time complexity (meaning: no loop at all).

  • Custom User Avatar

    I guess you try to build all the points? You need somethign more efficient, so another algo.