Skip to content

Instantly share code, notes, and snippets.

@inspirit941
Created April 2, 2020 03:54
Show Gist options
  • Select an option

  • Save inspirit941/6a2f5788272bb425c75c2bd44491ee73 to your computer and use it in GitHub Desktop.

Select an option

Save inspirit941/6a2f5788272bb425c75c2bd44491ee73 to your computer and use it in GitHub Desktop.
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
@Zagg2732
Copy link

Zagg2732 commented Jul 2, 2020

도움이 많이됩니다 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment