We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
@adi7tya & @badal_bokaro
if u add st in stk before the while it will work correctlly (means adding empty string in stack)
or
u can add in case 4;;=======
else if(x==4) { s.pop(); if(s.empty()) st="";
else {st=s.top();}}
i think u will understood the reason of segma. fault
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Text Editor
You are viewing a single comment's thread. Return to all comments →
@adi7tya & @badal_bokaro if u add st in stk before the while it will work correctlly (means adding empty string in stack) or u can add in case 4;;======= else if(x==4) { s.pop(); if(s.empty()) st=""; else {st=s.top();}}
i think u will understood the reason of segma. fault