Unpack sensor fields
Your task
A sensor gateway squeezes every reading into one 32 bit word before putting it on the wire. field_widths describes the layout in order: field_widths[0] is the width of the first field, and that field occupies the lowest bits of the word, counting the least significant bit as bit 0. Each later field sits immediately above the one before it. Every field holds an unsigned value, and the widths add up to 31 or fewer, so any bits above the last field are padding and must be ignored. A width of 0 marks a field that was reserved but never wired up, and it reads as 0. packed_words holds one word per reading. Return one row per reading, in the order the words are given, each row holding that reading's field values in layout order. An empty layout gives every reading an empty row.
Examples
unpack_reading_fields(packed_words: list[int], field_widths: list[int]) -> list[list[int]]unpack_reading_fields([2905, 3983], [4, 3, 5])[[9, 5, 22], [15, 0, 31]]unpack_reading_fields([1074808776], [8, 8])[[200, 71]]