Tag: iterator
Flatten 2D Vector #3rd attempt
Date: 2/2/2024Tags:algorithmsleetcodeiteratorThis journal entry describes the third attempt at solving the flatten 2D vector problem using a code snippet, where a Vector2D class is implemented to handle the iteration over the vector elements.
RLEIterator - 2nd attempt
Date: 1/31/2024Tags:algorithmsleetcodeiteratorThe journal entry titled "RLEIterator - 2nd attempt" describes the author's second attempt at solving the RLEIterator problem, by translating the encoding array into a private arr of objects with num and count properties, and using a for loop to iterate over the array and update the count of each item. The provided material is a code for a class called RLEIterator that implements this logic.
RLE Iterator
Date: 1/30/2024Tags:algorithmsleetcodeiteratorThe journal entry provides a solution to the RLE iterator problem, explaining how the class RLEIterator works using an encoding array to store information and a method called "next" to retrieve the next n elements based on the RLE data.
Peeking Iterator #2nd attempt
Date: 1/27/2024Tags:algorithmsleetcodeiteratorThe journal entry discusses the author's second attempt at solving the Peeking Iterator problem, explaining the concept of peeking in an iterator and providing a code implementation using the Iterator's API interface.
Peeking Iterator
Date: 1/26/2024Tags:algorithmsleetcodeiteratorThe journal entry titled "Peeking Iterator" solves the problem of implementing a peek method in an iterator, using a code that stores the next element in a variable called peekNum.