A simple algorithm to find the index of the 0 which, if converted to 1, will make the longest sequence of the number 1 in an array containing only zeros and ones.
If there are multiple results, the last one will be returned.
To execute the function use the following command in the terminal :
npm run exec <your array here>
npm run exec 1,0,0,1 must return 2
npm run exec 1,1,0,1,1,0,1,1 must return 5
npm run exec 1,0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0,1,1 must return 10