Given a sequence of non-negative integers, find the subsequence of length 3 having maximum product with the numbers of the subsequence being in ascending order.

Examples:

Input: arr[] = {6, 7, 8, 1, 2, 3, 9, 10} Output: 8 9 10 Input: arr[] = {1, 5, 10, 8, 9} Output: 5 8 9

Since we want to find the maximum product, we need to find following two things for every element in the given sequence:**LSL:** The largest smaller element on left of given element**LGR:** The largest greater element on right of given element.

## Recommended Posts:

- Maximum product of an increasing subsequence
- Maximum product of an increasing subsequence of size 3
- Maximum length subsequence such that adjacent elements in the subsequence have a common factor
- Maximum Sum Increasing Subsequence | DP-14
- Printing Maximum Sum Increasing Subsequence
- Maximum product of subsequence of size k
- Maximum Sum Subsequence of length k
- Maximum length subsequence possible of the form R^N K^N
- Maximum Bitwise AND value of subsequence of length K
- Maximum length prefix of one string that occurs as subsequence in another
- Minimal product subsequence where adjacent elements are separated by a maximum distance of K
- Find length of longest Fibonacci like subsequence
- Find Maximum Sum Strictly Increasing Subarray
- Find the maximum element in an array which is first increasing and then decreasing
- Find the maximum sum of digits of the product of two numbers

**Practice Tags :**