Skip to content

Commit b620621

Browse files
authored
Create 1716-calculate-money-in-leetcode-bank.js
1 parent f5cfd10 commit b620621

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @param {number} n
3+
* @return {number}
4+
*/
5+
const totalMoney = function(n) {
6+
let total = 0
7+
for(let i = 0 ; i < n; i++) {
8+
const base = (i / 7) >> 0
9+
const remain = i % 7 + 1
10+
total += base + remain
11+
}
12+
13+
return total
14+
};

0 commit comments

Comments
 (0)