Skip to content

1464-maximum-product-of-two-elements-in-an-array

DevGod
DevGod
Vtuber
/**
* @param {number[]} nums
* @return {number}
*/
var maxProduct = function(nums) {
const numQ = new MaxPriorityQueue();
for(a of nums){
numQ.enqueue(a);
}
return (numQ.dequeue()['element']-1)*(numQ.front()['element']-1)
};