diff --git a/NeetCodeRoadmap/Arrays_and_Hashing/Encode_Decode_Strings.py b/NeetCodeRoadmap/Arrays_and_Hashing/Encode_Decode_Strings.py index e4c3aec..bfd72da 100644 --- a/NeetCodeRoadmap/Arrays_and_Hashing/Encode_Decode_Strings.py +++ b/NeetCodeRoadmap/Arrays_and_Hashing/Encode_Decode_Strings.py @@ -1,9 +1,14 @@ -def encode(self, strs): +def encode(strs): # write your code here + key = [] + encode = [] + for x in strs: + if x in key: + encode.append(x) """ @param: str: A string @return: decodes a single string to a list of strings """ -def decode(self, str): +def decode(str): # write your code here \ No newline at end of file