521. Longest Uncommon Subsequence I ¶ Time: $O(\max(|\texttt{a}|, |\texttt{b}|))$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: int findLUSlength(string a, string b) { return a == b ? -1 : max(a.length(), b.length()); } }; 1 2 3 4 5class Solution { public int findLUSlength(String a, String b) { return a.equals(b) ? -1 : Math.max(a.length(), b.length()); } } 1 2 3class Solution: def findLUSlength(self, a: str, b: str) -> int: return -1 if a == b else max(len(a), len(b))