Function to check if chocolates can be eaten for ' mid ' no . of days
function helper ( mid ) { var cnt = 0 ; mp . forEach ( ( value , ) => { var temp = value ; while ( temp >= mid ) { temp -= mid ; cnt ++ ; } } ) ;