← 返回 openai 的题目列表Map Serialization and De-serialization
类型:online_judge
Design an algorithm to serialize and deserialize a map. The map can be represented as a 2D character array containing '0' for empty land and '1' for terrain. You need to implement serialize and deserialize methods. The serialize method takes a map and returns a string, while the deserialize method takes a string and returns the original map. Assume the map does not exceed 100x100 in size. Provide at least three test cases.
Example
Input
[['0', '1'], ['1', '0']]