Added missing <algorithm> header