Encode and Decode Strings
Design an algorithm to encodea list of stringstoa string. The encoded string is then sent over the network and is decoded back to the original list of strings.
Example
Machine 1 (sender) has the function:
Machine 2 (receiver) has the function:
So Machine 1 does:
and Machine 2 does:
strs2
in Machine 2 should be the same asstrs
in Machine 1.
Implement theencode
anddecode
methods.
Note
list of string
直接加“/”分割
Code
Last updated