Why does the example use left = Math.max(left, lastSeen.get(c) + 1)?
left = Math.max(left, lastSeen.get(c) + 1)