• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
May 26, 2022 |270 Views

Find the Increasing subsequence of length three with maximum product

  Share   Like
Description
Discussion

Given an array of distinct positive integers, the task is to find the maximum product of increasing subsequence of size 3, i.e., we need to find arr[i]*arr[j]*arr[k] such that arr[i] < arr[j] < arr[k] and i < j < k < n 
Examples:

Input: arr[] = {10, 11, 9, 5, 6, 1, 20}
Output: 2200                                        
Explaination: Increasing sub-sequences of size three are {10, 11, 20} => product 10*11*20 = 2200 {5,  6, 20} => product 5*6*20 = 600 Maximum product : 2200

 

Find the Increasing subsequence of length three with maximum product: https://www.geeksforgeeks.org/maximum-product-increasing-subsequence-size-3/