Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

aman_012's blog

By aman_012, history, 5 weeks ago, In English,

Hey there!

I came across this problem [](https://www.spoj.com/problems/JNEXT/) under the tag of stack and queues and would like to know the solution for the same. I got it accepted using basic logic but couldn't find any solution using stacks or queues.

Thanks in advance.

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it