We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3aba645 commit 01f33e1Copy full SHA for 01f33e1
src/_Problems_/max-product-of-3-numbers/index.js
@@ -9,7 +9,7 @@
9
10
/** The following solution is O(nlogn) because of sorting */
11
function maxProductof3Numbers(arr) {
12
- if (!Array.isArray(arr) || arr.length <= 2) {
+ if (!Array.isArray(arr) || arr.length < 3) {
13
throw new Error('Invalid Argument');
14
}
15
@@ -30,7 +30,7 @@ function maxProductof3Numbers(arr) {
30
31
/** The following solution is O(n) */
32
function maxProductof3NumbersII(arr) {
33
34
35
36
0 commit comments