← ALL NOTES
Array

2873. Maximum Value of an Ordered Triplet I

Given nums, for index triples i < j < k the triplet value = (nums[i] − nums[j]) × nums[k]. Find the maximum over all triples; if all values are negative, return 0. Fix k as the rightmost element and…

Loading…