013's blog

By 013, 9 years ago, In English

Help plz. Why is this submission getting wrong answer on test 19?

Thanks in advance :)

problem link

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

»
9 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Consider the following test:

5
3
3
3
3
0 

Your Output:

pushStack
pushQueue
pushFront
3 popStack popQueue popFront

Notice that you are not printing anything for the 4th query because temp is 3
You should make sure to mark a value visited when pushing it into one of the containers
AC Code 12958573

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you are so great. Thank you :)