Easy
Longest Uncommon Subsequence I — Python
Full explanation · Time O(min(a, b)) · Space O(1)
# Time: O(min(a, b))
# Space: O(1)
class Solution(object):
def findLUSlength(self, a, b):
"""
:type a: str
:type b: str
:rtype: int
"""
if a == b:
return -1
return max(len(a), len(b))