careercup / CtCI-6th-Edition

Cracking the Coding Interview 6th Ed. Solutions
11.33k stars 4.41k forks source link

Update MultiStack.java #241

Open john916zhang opened 2 years ago

john916zhang commented 2 years ago

We should use lastElementIndex instead of lastCapacityIndex. In the current approach, all elements will move to the very end of the capacity, not necessarily one forward.