Java solution with sorting
In a sorted array, the maximum product will be either the last three largest elements or the first two (negative elements) multiplied by the last (largest) elem
In a sorted array, the maximum product will be either the last three largest elements or the first two (negative elements) multiplied by the last (largest) element.\n```\nclass Solution {\n    public int maximumProduct(int[] nums) {\n        Arrays.sort(nums);\n        int len = nums.length;\n        \n        return Math.max(nums[0]*nums[1]*nums[len-1], nums[len-1] * nums[len-2] * nums[len-3]);\n    }\n}\n```
['Java']