Code RoomRadio frame corruption
EasyPrep Room Coding #4835

Radio frame corruption

CodingAlgorithms & data structuresEntry–Mid~14 min

A radio link protects every frame with a single check byte and the receiver has to spot the frames that arrived damaged. Each entry of frames is one received frame: the entries before the last one are the payload bytes, and the last entry is the check byte the sender appended. Every value is a byte from 0 to 255. The sender builds the check byte by starting a running value at 0 and, for each payload byte in order, rotating the running value left by one place inside eight bits, so the bit leaving the top comes back in at the bottom, then combining the byte into it with XOR. A frame carrying no payload at all therefore expects a check byte of 0. Return the positions of the frames whose check byte does not match, in ascending order. Every frame holds at least one entry.

Implement
corrupt_frame_indexes(frames: list[list[int]]) → list[int]
Examples
in[[[18,200,7,222],[5,5,99]]]out[1]
in[[[128,128],[64,64,192]]]out[]
in[[[0],[9]]]out[1]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 14 min
InputExpectedGot
[[[18,200,7,222],[5,5,99]]][1]not run yetsample
[[[128,128],[64,64,192]]][]not run yetsample
[[[0],[9]]][1]not run yetsample