diff options
author | terminaldweller <devi@terminaldweller.com> | 2023-12-04 23:53:24 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2023-12-04 23:53:24 +0000 |
commit | b85fa3292d1973789c570911c0fd598f9cd51a69 (patch) | |
tree | 4f605a998a07de9163ecbae5226295ca517ab40c /2264 | |
parent | 9,1266 (diff) | |
download | leetcode-b85fa3292d1973789c570911c0fd598f9cd51a69.tar.gz leetcode-b85fa3292d1973789c570911c0fd598f9cd51a69.zip |
2264
Diffstat (limited to '2264')
-rwxr-xr-x | 2264/main.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/2264/main.py b/2264/main.py new file mode 100755 index 0000000..0e88ad8 --- /dev/null +++ b/2264/main.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +class Solution: + def largestGoodInteger(self, num: str) -> str: + if '999' in num: + return '999' + if '888' in num: + return '888' + if '777' in num: + return '777' + if '666' in num: + return '666' + if '555' in num: + return '555' + if '444' in num: + return '444' + if '333' in num: + return '333' + if '222' in num: + return '222' + if '111' in num: + return '111' + if '000' in num: + return '000' + return "" + +def main(): + solution = Solution() + print(solution.largestGoodInteger("6777133339")) + +if __name__ == "__main__": + main() |