link to ques:https://hack.codingblocks.com/contests/c/457/330
STOCK SPAN PROBLEM--getting run error
As you have taken so less memory for array , you must be getting run error . So, Just increase the array size and dat’s it !!
https://ide.codingblocks.com/#/s/17745