Your task is to define a union ByteSplitter that allows viewing a 16-bit number both as a whole word and as two separate bytes.
ByteSplitter
word
bytes[2]
Example Input:
4660
Output:
LSB=52 MSB=18
Explanation:
4660 = 0x1234,
so LSB = 0x34 = 52,
MSB = 0x12 = 18.
Test Cases
Test Results
Input
Expected Output