Ad
  • Custom User Avatar

    The expected complexity should be O(str1.length + str2.length). Your solution is O(N^2) because searching is O(N)

  • Custom User Avatar

    With your code in repl.it I get the wrong result. The test string is this: 71899703 200 6 91 425 4 67407 7 96488 6 4 2 7 31064 9 7920 1 34608557 27 72 18 81. You need to fix your sort function.