Given an array seats representing a row of seats, where 1 indicates an occupied seat and 0 indicates an unoccupied seat, return the maximum distance from an unoccupied seat to the nearest occupied seat.
Example 1:
Input: seats = [1, 0, 0, 0, 1]
Output: 2
*Explanation: The unoccupied seat at index 2 is the farthest from the nearest occupied seat, which is at index 1 or 4.
Example 2:
Input: seats = [0, 1]
Output: 1
*Explanation: The unoccupied seat at index 0 is 1 seat away from the occupied seat at index 1.
1 <= seats.length <= 2 * 10^4seats[i] is 0 or 1.