Last active
March 19, 2020 22:45
-
-
Save RP-3/29b089182ff0089347c47071df2ad992 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First solution | |
class Solution: | |
def findLUSlength(self, a: str, b: str) -> int: | |
if len(a) != len(b): | |
return len(a) if len(a) > len(b) else len(b) | |
if a != b: return len(a) | |
return None | |
# simplified | |
class Solution: | |
def findLUSlength(self, a: str, b: str) -> int: | |
if a == b: return -1 | |
return len(a) if len(a) > len(b) else len(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment