Maximum pads that seat

Write codeHard35 min

Your task

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.

Examples

max_seated_pads(pad_x: list[int], pad_y: list[int], hole_x: list[int], hole_y: list[int]) -> int
Example 1
Inputmax_seated_pads([0, 1, 0], [0, 0, 1], [5, 6, 5], [5, 5, 6])
Output3
Example 2
Inputmax_seated_pads([0, 2], [0, 0], [0, 1, 3], [0, 0, 0])
Output2
Example 3
Inputmax_seated_pads([0, 1], [0, 0], [], [])
Output0