• + 1 comment

    C++ USERS

    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>