[Java] 3-pointer Method {99.73%} faster than orther solutions
If you do like solution please upvote it , so it could be helpful to orthers\nSorting Method :\n\nclass Solution {\n    public int maximumProduct(int[] nums) {\
**If you do like solution please upvote it , so it could be helpful to orthers**\nSorting Method :\n```\nclass Solution {\n    public int maximumProduct(int[] nums) {\n        \n        Arrays.sort(nums);\n        int n = nums.length;\n       return Math.max(nums[n-1]*nums[n-2]*nums[n-3] , nums[0]*nums[1]*nums[n-1]);\n    }\n}\n```\n3 Pointer Method\n```\nclass Solution {\n    public int maximumProduct(int[] nums) {\n\n        int min1 = Integer.MAX_VALUE,min2 = Integer.MAX_VALUE;\n        int max1 = Integer.MIN_VALUE , max2 = Integer.MIN_VALUE , max3 = Integer.MIN_VALUE ;\n        \n        for(int i = 0 ; i < nums.length ; i++){\n//             to find max1 , max2 , max3 in the array\n            if(nums[i]>max1){\n                max3 = max2 ;\n                max2 = max1 ;\n                max1 = nums[i];\n                \n            }else if (nums[i]>max2){\n                max3=max2;\n                max2=nums[i];\n            }else if (nums[i]>max3){\n                max3=nums[i];\n            }\n//             To find min1 , min2 in the array\n            if(nums[i]<min1){\n                min2 = min1;\n                min1 = nums[i];\n            }else if(nums[i]<min2) {\n                min2 = nums[i];\n            }\n        }\n        return Math.max(max1*max2*max3 , min1*min2*max1);\n    }\n\n}\n```
['Sorting', 'Java']