Wrong code to push in the stack.
Author: Ritabrata95Created Feb 10, 2024Updated Feb 10, 2024
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