first and second, find the longest string that is a subsequence of exactly one of them: it can be obtained from one but not from the other. Return its length, or -1 if no such string exists.first="note", second="notebook" → 8
notebook cannot be obtained by deleting letters from the shorter note, so the whole 8-letter string works.
first="plum", second="pear" → 4
plum cannot be made from pear or the other way round, so the answer is 4.
first="echo", second="echo" → -1
The strings are equal, so anything one of them yields the other yields too.
first="note", second="notebook"
8
Run checks the first 3 tests in your browser. Submit checks all 124 tests on the server, hidden ones included.