Codility
Codility copied to clipboard
Update Peaks logic to avoid extra loops
Max number of blocks can't exceed peaks count, so that all have at least 1 peak. This also avoids looping when there are no peaks.