DNS name decoding
Your task
Decode a DNS-style domain name from its wire encoding. The input is a list of byte values (ints 0-255). A name is a sequence of labels; each label is one length byte followed by that many ASCII character bytes, and the name ends at a zero length byte. Reconstruct the dotted name (e.g. 'www.example.com'). The root (a single 0 byte) decodes to the empty string.
Examples
decode_dns_name(data: list[int]) -> strExample 1
Input
decode_dns_name([3, 119, 119, 119, 7, 101, 120, 97, 109, 112, 108, 101, 3, 99, 111, 109, 0])Output
"www.example.com"