= $totalBlockSize; $i++) { $totalBlockSize += $blocks[$i]; } $ans = $i - 1; } else { $ans = $num; } echo $ans."\n";