-
-
Save yungyungGwon/a1193b9c669d5194b901c6ed33c39f26 to your computer and use it in GitHub Desktop.
This file contains 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(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