When debugging an embedded component used with HCLTech engineering tools, you may receive a 32-bit integer and the four bytes observed in memory. Determine whether those bytes represent the integer in little-endian or big-endian order.
Return "little" if the bytes match little-endian representation, "big" if they match big-endian representation, and "unknown" if they match neither or both representations. Matching both representations can occur when the byte sequence reads the same forward and backward, such as [18, 52, 52, 18].
Implement detect_endianness(value, memory_bytes).
value is an integer from 0 through 2^32 - 1.memory_bytes is a list of exactly four integers, each from 0 through 255."little", "big", or "unknown".def detect_endianness(value, memory_bytes):