Curefit analyzes three workout metrics selected from a chronological array. Given an integer array nums, find indices i < j < k such that nums[i] * nums[j] * nums[k] is maximized. Return the three selected values in their original index order.
You must design an algorithm better than checking every possible triplet. If multiple triplets have the same maximum product, return any one of them.
nums with at least three elements.nums[i], nums[j], and nums[k], in increasing index order, where the product is maximum.def maximum_product_triplet(nums):