Skip to content

Commit 1ab820a

Browse files
committed
0901
1 parent 7697d57 commit 1ab820a

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var dominantIndices = function (nums) {
6+
const len = nums.length;
7+
8+
let count = 0;
9+
let sum = nums[len - 1];
10+
11+
for (let i = len - 2; i >= 0; i--) {
12+
if (nums[i] > sum / (len - i - 1)) count++;
13+
sum += nums[i];
14+
}
15+
16+
return count;
17+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @param {number[]} piles
3+
* @return {boolean}
4+
*/
5+
var stoneGame = function (piles) {
6+
for (let i = 0; i < piles.length / 2; i++) {
7+
// 현재 점수가 낮더라도 나중에 이길수있음
8+
}
9+
};

0 commit comments

Comments
 (0)