We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Doing a index[i]++ is essentially doing a fetch & pop operation on that stack since doing an actual pop would be expensive on large datasets. OP is keeping track where the top of each stack is using the index array.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equal Stacks
You are viewing a single comment's thread. Return to all comments →
Doing a index[i]++ is essentially doing a fetch & pop operation on that stack since doing an actual pop would be expensive on large datasets. OP is keeping track where the top of each stack is using the index array.