General solution for any K 
This is the first solution that can be used to solve the problem, Maximum Prodoct of K Numbers.\nHope it can help others when encountering a follow up question.
This is the first solution that can be used to solve the problem, Maximum Prodoct of K Numbers.\nHope it can help others when encountering a follow up question.\n```\n    public int maximumProduct(int[] nums) {\n        Arrays.sort(nums);\n        // if signs of the minimum and maximum number are the same, simply return this.\n        // Assume no overflow problem will occur.\n        if(nums[0]*nums[nums.length-1] >= 0) return nums[nums.length-1]*nums[nums.length-2]*nums[nums.length-3];\n        int l = 0, r = nums.length-1;\n        int product = 1;\n        // k = 3 in this case. But it should be extended to any number.\n        // if count is odd, we should take the rightmost number. Otherwise, we should take the maximum product by comparing\n        // the product of two leftmost elements and that of two rightmost elements.\n        int count = 3;\n        while(count > 0) {\n            if(count % 2 == 1) {\n                product *= nums[r--];\n            }\n            else {\n                if(nums[r]*nums[r-1] > nums[l]*nums[l+1])\n                    product *= nums[r--] * nums[r--];\n                else\n                    product *= nums[l++] * nums[l++];\n                count--;\n            }\n            count--;\n        }\n        return product;\n    }\n```
[]