Created
April 2, 2020 03:54
-
-
Save inspirit941/6a2f5788272bb425c75c2bd44491ee73 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
| def solution(s): | |
| s = s[2:-2].split("},{") | |
| sorted_s = sorted(s, key = lambda x: len(x)) | |
| answer = [] | |
| check = set() | |
| for value in sorted_s: | |
| for each_value in value.split(","): | |
| if each_value not in check: | |
| answer.append(int(each_value)) | |
| check.add(each_value) | |
| break | |
| return answer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
도움이 많이됩니다 감사합니다.