Solution for MaxProductOfThree