Full threadghj·I've actually gotten this question in a google interview before: https://leetcode.com/problems/peeking-iterator/View on HN