CSV line parser
Parse one line of RFC-4180-style CSV into a list of field strings. Fields are comma-separated. A field may be double-quoted; inside a quoted field, a comma is literal and a doubled quote ("") encodes a single quote character. Quoted fields may themselves be empty. Assume the input is a single well-formed record with no newlines. Return the list of decoded field values (quotes stripped, escapes resolved).
Implement
parse_csv_line(line: str) → list[str]Examples
in
["a,\"b,c\",d"]out["a","b,c","d"]What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 30 min
solution.py
InputExpectedGot
["a,\"b,c\",d"]["a","b,c","d"]not run yetsample