added for loop method to encode and decode
This commit is contained in:
parent
0f650a6ed9
commit
050d2f4041
@ -1,9 +1,14 @@
|
|||||||
def encode(self, strs):
|
def encode(strs):
|
||||||
# write your code here
|
# write your code here
|
||||||
|
key = []
|
||||||
|
encode = []
|
||||||
|
for x in strs:
|
||||||
|
if x in key:
|
||||||
|
encode.append(x)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@param: str: A string
|
@param: str: A string
|
||||||
@return: decodes a single string to a list of strings
|
@return: decodes a single string to a list of strings
|
||||||
"""
|
"""
|
||||||
def decode(self, str):
|
def decode(str):
|
||||||
# write your code here
|
# write your code here
|
||||||
Loading…
Reference in New Issue
Block a user