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.
I thought of both editorial solution and hashmap solution but as the question belongs to dequeue category, I tried to get an answer using dequeue and couldn't make any logic. Then, I checked the editorial and I am really disappointed that it is not up to the mark.
This question does not belong to dequeue. Even, editorial have just used dequeue for no purpose. An array or hashmap would be sufficient. I must say that if you are putting a question under some category then atleast make that category applicable.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Dequeue
You are viewing a single comment's thread. Return to all comments →
I thought of both editorial solution and hashmap solution but as the question belongs to dequeue category, I tried to get an answer using dequeue and couldn't make any logic. Then, I checked the editorial and I am really disappointed that it is not up to the mark.
This question does not belong to dequeue. Even, editorial have just used dequeue for no purpose. An array or hashmap would be sufficient. I must say that if you are putting a question under some category then atleast make that category applicable.