Official algorithmic problem description and constraints.
Alice and Bob came up with a rather strange game. They have an array of integers π1,π2,β¦,ππ. Alice chooses a certain integer π and tells it to Bob, then the following happens:
Help Alice find the maximum π at which she is guaranteed to win.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.