Find the distance from mid index to closest index

Given an array, you need to find the index i such that 1s to the left of i are 0, and the distance to the nearest 1 on the right side is minimized. Implement the function `def find_mid_index_dista...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: