Why it is giving wrong output? https://ide.codingblocks.com/s/344254 Please tell. Correct O/P I have mentioned in comments

Why it is giving wrong output?


Please tell.

Correct O/P I have mentioned in comments.

hello @cbcao263
image

here u have given input in two lines,

but u r reading them as cin>>s; , this will read only string of first line and ignore the second line, that is why it is giving u wrong output.

give ur input like this->
image
and then it will give u correct result

1 Like

Okayyy bro,
THanks a lot.

bas ab smjh aagya
krte hain fir
Thnx.

Bro, Yeh code check krdo Plz.
Ek baar
ans mein dikkat aarhi
bhut mushkil se logic bnaaya

@cbcao263
i m not having access to the contest , can u please submit this code ->

pls do let me know whether it is working or not

1 Like

Sir, Isme 1 doubt aarha
Like In 1st Output only,
You are not getting some characters
like w,y missing hain /

try now->

1 Like

Partially Correct.
Ek baar sir aapka solution smjhlu plz
aaj khud bhi try krta hu
wrna aapse puchta hu.

Thanks a lot for this.

jo bola hai wahi kiya hai maine,
agar bich ke element chote hain to mein unko queue mein store kar le raha hu,aur agar wo bade hai to stack mein
aur baaki element ko dq mein.
phir pehle que print kar raha hu , then dq and then stack.

WA ka pata nahi kyun aa raha hai,logic to yahi hai

1 Like

Hanjiii Sir, Shi baat hai aapki…

Shyd kuch edge cases ka issue ho.
Dekhta hu ek baar aur aapko bhi btata hu
ki hua ya nhi.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.