Flatten Nested List Iterator | Live Coding with Explanation | Leetcode - 341

preview_player
Показать описание


To support us you can donate

Check out our other popular playlists:

If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful.

#coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode
Рекомендации по теме
Комментарии
Автор

We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!!

Questions you might like:

Struggling in a question??

Leave in a comment and we will make a video!!!🙂🙂🙂

AlgorithmsMadeEasy
Автор

Thanks for the great video! It is confusing that a NestedInteger can either be a integer or a list. Also, I wonder why the NestedIterator class is used if it is not a part of the java standard library.

bent
Автор

I think space complexity of O(n) is not great.
In interviews, if we give this solution, we will definitely be asked to optimize space further.

dataman
Автор

very good explaination. Thank you for the efforts man.

manishbolbanda
Автор

excellent!

i am using python but i can code the solution myself from your video! thx!

hoyinli
Автор

An iterator is only supposed to load the next element... otherwise what would be the point?

tanmaysingal
Автор

Very nice informative video!!
Keep doing... :)

suchitragiri
Автор

Where are you told that NestedInteger is an iterable ie. Why you don’t have to call getList()

rydmerlin
Автор

Super weird question... but well explained

fanigo
Автор

same approach thought but could not code it up

samkitjain
Автор

An iterator should never copy the input data structure.

ameynaik
Автор

Your solution broke the iterator concept, iterator is lazy, you cannot pre calculate the whole list until user asked for, like next() function in this case. You have to calculate the result every time next() been called. In case the input size in millions your code will be loading all the no's in memory first and when we call next() only one time still you had unnecessary flattened the entire input

joydeeprony
Автор

an Iterator should never copy the data structure

thewanderingrooh