MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Constructor

Function Constructor

flatten_nested_list_iterator_341/solution.go:96–106  ·  view source on GitHub ↗
(nestedList []*NestedInteger)

Source from the content-addressed store, hash-verified

94}
95
96func Constructor(nestedList []*NestedInteger) *NestedIterator {
97 stack := new(Stack)
98 stack.Push(&ListIndex{
99 Idx: 0,
100 List: nestedList,
101 })
102
103 return &NestedIterator{
104 stack: stack,
105 }
106}
107
108func (this *NestedIterator) Next() int {
109 current := this.stack.Peek()

Callers 1

TestIteratorFunction · 0.70

Calls 1

PushMethod · 0.45

Tested by 1

TestIteratorFunction · 0.56