Longest repeated frame block
A link tester records the frames a radio receives as one string, one letter per frame type. When the link stutters the receiver takes a block of frames and then immediately takes the very same block again, sometimes several times over, with nothing in between. Given the capture, return the length of the longest stretch that is one block written two or more times back to back. Such a stretch is always a whole number of copies, so its length is a multiple of its block length. Return 0 when no stretch qualifies. Copies have to be adjacent: in abcxabc the two copies of abc are separated, so nothing qualifies, while abcabcab answers 6. A run of one letter counts too, since a single letter is a block, so aaaaa answers 5.
longest_tandem_burst(capture: str) → int["abcabcab"]out6["abcxabc"]out0["aaaaa"]out5State 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.
["abcabcab"]6not run yetsample["abcxabc"]0not run yetsample["aaaaa"]5not run yetsample