Skip to content

Instantly share code, notes, and snippets.

@yungyungGwon
Created October 1, 2021 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yungyungGwon/a1193b9c669d5194b901c6ed33c39f26 to your computer and use it in GitHub Desktop.
Save yungyungGwon/a1193b9c669d5194b901c6ed33c39f26 to your computer and use it in GitHub Desktop.
def solution(number, k):
answer = []
for i in number:
while k > 0 and answer and answer[-1]<i:
answer.pop()
k -= 1
print(answer)
answer.append(i)
print(answer)
return ''.join(answer[:len(answer) - k])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment