Leetcode 3584. Maximum Product of First and Last Elements of a Subsequence
Choose a subsequence of length m that maximizes the product of its first and last elements — equivalently, pick indices i ≤ j with j − i + 1 ≥ m to maximize nums[i] * nums[j]. The core challenge is optimizing this pair selection under the index-distance constraint while handling sign effects (negatives and the m=1 squared case).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.