Question
Two integer lists have the same shape when equality between positions lines up exactly: for every pair of indices i and j, a[i] == a[j] holds precisely when b[i] == b[j]. Put differently, one list can be turned into the other by consistently renaming values, with distinct values staying distinct. Lists of different lengths never match. Return whether the two lists have the same shape. For example, [1, 2, 1] and [7, 9, 7] do; [1, 1] and [2, 3] do not; and [1, 2] versus [3, 3] also do not.
same_shape(a: list[int], b: list[int]) → bool[[1,2,1],[7,9,7]]outtrueState 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.