You are viewing a single comment's thread. Return to all comments →
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.
Seems like cookies are disabled on this browser, please enable them to open this website
Min Max Riddle
You are viewing a single comment's thread. Return to all comments →
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.