Implement serialization and deserialization for a singly linked list: serialize converts the list to a string, and deserialize rebuilds the list from that string. To verify correctness, the input list is serialized and then deserialized, and the resulting list is returned as an array (which must equal the original).
Input: An array of node values.
Output: Array — the list after a serialize/deserialize round trip.
Input: [1,2,3,4]
Output: [1,2,3,4]
Explanation: Round trip preserves the list.Input: [1]
Output: [1]
Explanation: Single node.Input: []
Output: []
Explanation: Empty list.0<=n<=10^4-10^9<=value<=10^9