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 e6b562f commit f8ebc59Copy full SHA for f8ebc59
394/README.md
@@ -0,0 +1,4 @@
1
+# Hi, SpasZahariev! Here is my help . My code is on Python3 scenario
2
+# Use Regex==regular expression is a sequence of characters that specifies a search pattern.
3
+
4
394/leetcode394-DecodeString.py
@@ -0,0 +1,12 @@
+class Solution:
+ def decodeString(self, s: str) -> str:
+ import re
+ patt = "(\d+)\[([a-z]+)\]"
5
6
+ found = re.findall(patt, s)
7
+ while found:
8
+ for rep, cnt in found:
9
+ s = s.replace(f'{rep}[{cnt}]', cnt * int(rep))
10
11
12
+ return s
0 commit comments