We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 95bd29d + 71a7f0c commit 50025c9Copy full SHA for 50025c9
2 files changed
live9/test93/문제1/백유진.py
@@ -0,0 +1,13 @@
1
+def solution(number, k):
2
+ answer = ''
3
+
4
+ stack = []
5
6
+ for num in number:
7
+ while k > 0 and stack and stack[-1] < num:
8
+ stack.pop()
9
+ k -= 1
10
+ stack.append(num)
11
12
+ answer = ''.join(stack[:len(number)-k])
13
+ return answer
live9/test93/문제2/백유진.py
@@ -0,0 +1,16 @@
+def solution(name):
+ answer = 0
+ min_cursor = len(name) - 1
+ for idx, alphabet in enumerate(name):
+ answer += min(ord(alphabet) - 65, 91 - ord(alphabet))
+ end = idx+1
+ while end < len(name) and name[end] == 'A':
+ end += 1
+ min_cursor = min(min_cursor, idx*2 + len(name)-end, (len(name)-end)*2 + idx)
14
+ answer += min_cursor
15
16
0 commit comments