I don't think `i - 1` is right. It should be the index of the first missing item in this hole.