Solved MaxProductOfThree in java