1/26/2024
Peeking Iterator
This is my attempt to solve Peeking Iterator problem.
An iterator always has 2 methods: next and hasNext. The prompt asks to implement peek method that only see the next element, not remove it like next. If you want to use some info again and again, the best thing to do is to store it somewhere, which is what I did. I use this.peekNum to store the next element. Whenever user calls peek, I don't need to call next again. I can just return peekNum.