Question
Extract the browser family and major version from a simplified User-Agent string. Look for the first token of the form Name/Version where Name is one of Chrome, Firefox, Safari, or Edge and Version starts with an integer major number. Return [name, major_version] with major_version as an int. If no recognized browser token is found, return ["unknown", -1].
parse_user_agent(ua: str) → list["Mozilla/5.0 Chrome/118.0.5993.88 Safari/537.36"]out["Chrome",118]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.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.