MAC address normalization
Normalize a MAC address to canonical lowercase colon-separated form. Accept input using colons, hyphens, or Cisco-style dotted groups as separators (e.g. '01:23:45:67:89:AB', '01-23-45-67-89-ab', '0123.4567.89ab'). A valid MAC has exactly 12 hexadecimal digits once separators are removed. Return the canonical form 'aa:bb:cc:dd:ee:ff' (lowercase), or 'invalid' if the input is not a well-formed MAC.
Implement
normalize_mac(mac: str) → strExamples
in
["01:23:45:67:89:AB"]out"01:23:45:67:89:ab"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 15 min
solution.py
InputExpectedGot
["01:23:45:67:89:AB"]"01:23:45:67:89:ab"not run yetsample