This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given an arrayOfInts, find the highestProduct you can get from three of the integers. | |
The input arrayOfInts will always have at least three integers. | |
Gotchas | |
Does your function work with negative numbers? If arrayOfInts is [−10,−10,1,3,2][-10, -10, 1, 3, 2][−10,−10,1,3,2] we should return 300300300 (which we get by taking −10∗−10∗3-10 * -10 * 3−10∗−10∗3). | |
We can do this in O(n)O(n)O(n) time and O(1)O(1)O(1) space. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.myBind = function (newThis, ...args1) { | |
var fn = this; | |
return function (...args2) { | |
return fn.apply(newThis, args1.concat(args2)); | |
}; | |
} | |
var math = { | |
add: function(a, b) { return a + b} | |
} |