Problem 3584 · Medium

Maximum Product of First and Last Elements of a Subsequence

The first and last picks must leave room for m minus 2 elements between them, so only index pairs at least m minus 1 apart are allowed.

Open the interactive visualisation