Question
A vibration sensor pads its log with zeros while it spins up and winds down, so a capture looks like [0, 0, 4, 0, 5, 0]. Given the readings, strip the leading zeros and the trailing zeros but keep any zeros in the middle (they are genuine readings), and return what remains. Move one pointer in from each end. An all-zero or empty log returns an empty list. Example above returns [4, 0, 5].
trim_zero_padding(readings: list[int]) → list[int][[0,0,4,0,5,0]]out[4,0,5]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.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.