Skip to content

Commit 5fa118f

Browse files
committed
総ACで降順ソートする
1 parent 932c16b commit 5fa118f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ function getMoreMotivatedUsers(atcoderIds: string[]): MoreMotivatedUser[] {
244244

245245
sheet.getRange(2, 1, data.length, sheet.getLastColumn()).setValues(data);
246246

247+
result.sort((a, b) => {
248+
if (a.targetAcceptedCount === b.targetAcceptedCount) {
249+
if (a.atcoderId < b.atcoderId) return -1;
250+
if (a.atcoderId > b.atcoderId) return 1;
251+
return 0;
252+
}
253+
254+
return b.targetAcceptedCount - a.targetAcceptedCount;
255+
});
256+
247257
return result;
248258
}
249259

0 commit comments

Comments
 (0)