python one line....


  • 0
    Z
    class Solution(object):
        def findLUSlength(self, a, b):
            """
            :type a: str
            :type b: str
            :rtype: int
            """
            return -1 if a == b else max(len(a), len(b))
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.