diff options
-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() |