@@ -0,0 +1,895 @@
+package fundamentals.string.search.lc521_longestuncommonsubsequence;%0A%0A/**%0A * Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings.%0A * The longest uncommon subsequence is defined as the longest subsequence of one of these strings and this subsequence should not be any subsequence of the other strings.%0A */%0Apublic class Solution %7B%0A%0A    public int findLUSlength(String a, String b) %7B%0A        return a.equals(b) ? -1 : Math.max(a.length(), b.length());%0A    %7D%0A%0A    // Only several cases possible:%0A    // 1) a=%22abcd%22, b=%22ab%22  =%3E lus=%22abcd%22%0A    // 2) a=%22ab%22,  b=%22abcd%22 =%3E lus=%22abcd%22%0A    // 3) a=%22def%22, b=%22def%22  =%3E lus=%22%22%0A    // 4) a=%22def%22, b=%22deg%22  =%3E lus=%22def%22 or %22deg%22%0A    public int findLUSlength_my(String a, String b) %7B%0A        int m = a.length(), n = b.length();%0A        return (m != n) ? Math.max(m, n) : (a.equals(b) ? -1 : m);%0A    %7D%0A%0A%7D%0A

longest uncommon subsequence