you give array represent row seat seatsi 1 represent person sit ith seat seatsi 0 represent ith seat 0indexedthere seat person sittingAlex want sit seat distance close person maximize return maximum distance close person Example 1input seat 1000101output 2explanation if Alex sit second open seat ie seats2 close person distance 2if Alex sit open seat close person distance 1thus maximum distance close person 2example 2input seat 1000output 3explanation if Alex sit seat ie seats3 close person 3 seat awaythis maximum distance possible answer 3example 3input seat 01output 1 constraints2 seatslength 2 104seatsi 0 1at seat emptyAt seat occupy