public static void main(String args[]){
        int arr[] = {6, 7, 8, 1, 2, 3, 9, 10};
        IncreasingSubsequnceOfLength3WithMaxProduct iss = new IncreasingSubsequnceOfLength3WithMaxProduct();
        System.out.println(iss.maxProduct(arr));
        int arr1[] = {1, 5, 10, 8, 9};
        System.out.println(iss.maxProduct(arr1));
    }
http://www.geeksforgeeks.org/increasing-subsequence-of-length-three-with-maximum-product/
Keep two arrays which keeps max from current position to right side
Other array keeps max on left size which is smaller than current element
Once you have these two arrays from 2nd to 2nd last position keep multiplying
elements at 3 arrays index position to get max product
Test cases
Negative numbers
0 in the input
src/com/interview/array/IncreasingSubsequnceOfLength3WithMaxProduct.java