Wrong code to push in the stack.

Author: Ritabrata95Created Feb 10, 2024Updated Feb 10, 2024

https://github.com/careercup/CtCI-6th-Edition/blob/59018cfcb90292209275db1c4b3ed306d4b07d7f/Java/Ch%2003.%20Stacks%20and%20Queues/Q3_01_Three_in_One/FixedMultiStack.java#L28

I think the correct code would be "values[indexOfTop(stackNum) + 1] = value;" because the existing code is overriding the top element instead of adding a new element in the top of the stack.

Source: careercup/CtCI-6th-Edition