Search
⌘K
Get Premium
Leetcode 900. RLE Iterator
Create an iterator over a run-length encoded array that, on each next(n) call, consumes n elements by advancing through (count, value) pairs and returns the last value consumed or -1 if the sequence is exhausted. The solution must maintain state across calls and efficiently skip/consume counts (n can be large).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.