class Solution(object):
def findLUSlength(self, a, b):
"""
:type a: str
:type b: str
:rtype: int
"""
if len(a) == len(b):
if a <> b:
return len(a)
else:
return -1
elif len(a) > len(b):
return len(a)
else:
return len(b)
转载于:https://www.cnblogs.com/ffeng0312/p/9399200.html