Min Max Riddle

  • + 1 comment

    Straighforward though optimized O(N^2) implementation (actually (N^2)/2 as per the tables in the explanations will timeout in C++ in TC3.

    Hint: How can you handle repeated sequences of the same value efficiently?

    Hint2: Can be solved without using stacks and/or queues.