TCP flags byte decoder

Write codeMedium15 minCisco style

Your task

A TCP segment's control bits are packed into a single byte. From least-significant to most-significant bit (bit 0 .. bit 7) the flags are: FIN, SYN, RST, PSH, ACK, URG, ECE, CWR. Given the integer value of that flags byte (0..255), return the list of set flag names in that bit order (bit 0 first). An all-zero byte returns an empty list.

Examples

decode_tcp_flags(flags_byte: int) -> list[str]
Example 1
Inputdecode_tcp_flags(18)
Output["SYN", "ACK"]