#3584
Maximum Product of First and Last Elements of a Subsequence
expert · 1110 · lc medium +32 · 31.3% accepted · 114 likes · top 9%
Description
Given an integer array nums and an integer m, find a subsequence of nums with exactly m elements.
Return the maximum possible product of the first and last elements of any such subsequence.
Code
1
2
3