Getting MLE when using struct in C


The code gives correct answer but exceeds memory limit. Well i’m using C and using a linked list and one integer variable, that’s all. How else am I supposed to implement a variable size stack in C if not using linked list?


Linked list is fine since the question did not specify maximum size of the stack. However for the solution check the linked list answer gave memory limit exceeded. So it’s an interviewBit issue i think.

The solution used :

int stack[10000000];