We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15f9b39 commit 500788dCopy full SHA for 500788d
real_interview_questions/Google/Decompressor.md
@@ -1,6 +1,8 @@
1
# QUESTION
2
Given a compressed string in which a number followed by [] indicate how many times those characters occur, decompress the string
3
+
4
Eg. : a3[b2[c1[d]]]e will be decompressed as abcdcdbcdcdbcdcde.
5
6
Assume the string is well formed and number will always be followed by a [].
7
8
# SOLUTION
@@ -15,7 +17,6 @@ def decompress(compressed_string):
15
17
return ''
16
18
token_stack = list()
19
result_stack = list()
- # token_stack.append(tokens[0])
20
curr_token_index = 0
21
while curr_token_index < len(tokens):
22
curr_token = tokens[curr_token_index]
0 commit comments