Stores sum of the initial array arr [ ]
let sum = 0 ; for ( let i = 0 ; i < N ; i ++ ) { sum = sum + arr [ i ] ; } if ( sum == 0 ) { return 0 ; } nearestLeft ( arr , N , steps ) ; nearestRight ( arr , N , steps ) ;