Skip to content

Instantly share code, notes, and snippets.

@terracotta-ko
Created June 1, 2018 10:16
gist for leetcode 628
class Solution {
public int maximumProduct(int[] nums) {
Arrays.sort(nums);
return Math.max(nums[0]*nums[1]*nums[nums.length-1], nums[nums.length-3]*nums[nums.length-2]*nums[nums.length-1]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment