You are given an array Parkings of size N, which represents parking spaces, and an integer K, which represents the number of cars you need to park in Parkings. The array Parkings contains only 0 and 1, where 0 represents an empty slot and 1 represents an occupied slot.
You have to park the cars in such a way that the minimum distance between cars is maximized.
Return the maximum distance that you can achieve.
This problem asks you to place K cars into a parking array while maximizing the minimum distance between any two parked cars. A standard approach is binary search on the answer, with a greedy feasibility check that scans the array and counts how many cars can be placed while keeping at least a candidate distance. Because the array contains only 0 and 1, the feasibility test can be done efficiently in one pass.