Back to problems

Parse a Custom Record with Fixed Fields, Mapped Keys, and Nested Lists

Algorithm · Netflix · Hard

Implement a parser that accepts a custom record string and builds a structured object. The record contains four fixed fields in order — an integer machine_code, an integer timestamp, a string field1, and a string field2 — followed by exactly one free-form block delimited by $[ and ]&. The input shape is: machine_code, timestamp, field1, field2, $[freeform]& The fixed prefix and free-form block must be identified using the $[ and ]& markers, not by blindly splitting every…

Checking your access…