`currMax` is a dense vector. So use a while loop.