Minimum parking spots needed

Write codeMedium15 minMeta style

Your task

A parking garage logs each car's visit as [arrive, depart] in minutes; a car holds a spot for the half-open span [arrive, depart), so a car arriving exactly as another departs can take over that spot. Given all visits for a day, return the minimum number of spots the garage needed, equivalently, the maximum number of cars present at any single moment. Example: [[0,30],[5,10],[15,20]] needs 2 spots.

Examples

min_spots(visits: list[list[int]]) -> int
Example 1
Inputmin_spots([[0, 30], [5, 10], [15, 20]])
Output2