Maximum pads that seat
A pick and place head lowers a component onto a drilled panel. The component's pads sit at whole millimetre coordinates pad_x[i] and pad_y[i], and the panel's holes sit at hole_x[j] and hole_y[j]. The head may slide the component by any whole number of millimetres east and north, but it never rotates or flips it, so every pad keeps its offset from every other pad. A pad seats when it lands exactly on a hole. No two pads share a position and no two holes share a position. Return the largest number of pads that can seat at once under one slide. Return 0 when there are no pads or no holes.
max_seated_pads(pad_x: list[int], pad_y: list[int], hole_x: list[int], hole_y: list[int]) → int[[0,1,0],[0,0,1],[5,6,5],[5,5,6]]out3[[0,2],[0,0],[0,1,3],[0,0,0]]out2[[0,1],[0,0],[],[]]out0State 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,1,0],[0,0,1],[5,6,5],[5,5,6]]3not run yetsample[[0,2],[0,0],[0,1,3],[0,0,0]]2not run yetsample[[0,1],[0,0],[],[]]0not run yetsample