From b85fa3292d1973789c570911c0fd598f9cd51a69 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Mon, 4 Dec 2023 18:53:24 -0500 Subject: 2264 --- 2264/main.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 2264/main.py (limited to '2264') 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() -- cgit v1.2.3