Skip to content

Commit e8041d2

Browse files
authored
Create 3232-find-if-digit-game-can-be-won.js
1 parent a918f2d commit e8041d2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

3232-find-if-digit-game-can-be-won.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {boolean}
4+
*/
5+
var canAliceWin = function(nums) {
6+
const sum = nums.reduce((ac, e) => ac + e, 0)
7+
let as = 0
8+
for(const e of nums) {
9+
if(e < 10) as += e
10+
}
11+
12+
return as !== sum - as
13+
};

0 commit comments

Comments
 (0)