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.
This problem can be completed in O(N) (linear) time complexity using std::queue<type>;if you've not utilized queue when solving the problem, you've not been successful (mind the category that the problem is in...)
HINTS:
- You require only the standard constructor class of std::queue<type>
- O(N) is possible; you must only iterate through the queue<type> once
- Mind the size of input variables; set type accordingly
- queue<type>'s type must make use of std::pair<type,type>
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Truck Tour
You are viewing a single comment's thread. Return to all comments →
C++ USERS
This problem can be completed in O(N) (linear) time complexity using
std::queue<type>
; if you've not utilizedqueue
when solving the problem, you've not been successful (mind the category that the problem is in...)HINTS:
- You require only the standard constructor class of
std::queue<type>
- O(N) is possible; you must only iterate through the
queue<type>
once- Mind the size of input variables; set
type
accordingly-
queue<type>
'stype
must make use ofstd::pair<type,type>