Two lines of Code || Java || C++
class Solution {\n    public int maximumProduct(int[] nums) {\n\t\n\t//As we know there is only two possibilties \n\t//1st possibilty: All numbers are positive 
class Solution {\n    public int maximumProduct(int[] nums) {\n\t\n\t//As we know there is only two possibilties \n\t//1st possibilty: All numbers are positive in that case we have return product of last three number of sorted array.\n \t// 2nd possibilty : There may be negative numbers also in that case we have to return product of two most negative number and one maximum possitive number\n\t\n       Arrays.sort(nums);\n        \n        return Math.max( (nums[0]*nums[1]*nums[nums.length-1]),(nums[nums.length-1]*nums[nums.length-2]*nums[nums.length-3] ));\n    }\n } \n # Press the above button if you like it\n
['Array', 'Sorting']