MAC address normalization
Your task
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.
Examples
normalize_mac(mac: str) -> strExample 1
Input
normalize_mac("01:23:45:67:89:AB")Output
"01:23:45:67:89:ab"