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 ebca97f commit 4b11e52Copy full SHA for 4b11e52
1 file changed
encode-and-decode-strings/HodaeSsi.py
@@ -0,0 +1,22 @@
1
+# 시간복잡도: O(n)
2
+# 공간복잡도: O(1)
3
+
4
+class Solution:
5
+ """
6
+ @param: strs: a list of strings
7
+ @return: encodes a list of strings to a single string.
8
9
+ def encode(self, strs):
10
+ if not strs:
11
+ return ""
12
+ return chr(257).join(strs)
13
14
15
+ @param: str: A string
16
+ @return: decodes a single string to a list of strings
17
18
+ def decode(self, str):
19
+ if not str:
20
+ return []
21
+ return str.split(chr(257))
22
0 commit comments