Skip to content

Latest commit

 

History

History

Maximum product of an increasing subsequence

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given an array of numbers, find the maximum product formed by multiplying numbers of an increasing subsequence of that array.

Input : arr[] = { 3, 100, 4, 5, 150, 6 }

Output : 45000

Maximum product is 45000 formed by the

increasing subsequence 3, 100, 150. Note

that the longest increasing subsequence

is different {3, 4, 5, 6}

Input : arr[] = { 10, 22, 9, 33, 21, 50, 41, 60 }

Output : 21780000

Maximum product is 21780000 formed by the

increasing subsequence 10, 22, 33, 50, 60.