We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71566c7 commit 1ad8ef4Copy full SHA for 1ad8ef4
scripts/algorithms/C/Calculate Money in Leetcode Bank/Calculate Money in Leetcode Bank.java
@@ -1,8 +1,9 @@
1
+// Runtime: 0 ms (Top 100.00%) | Memory: 39.1 MB (Top 94.89%)
2
class Solution {
3
public int totalMoney(int n) {
- int m=n/7; //(no.of full weeks)
4
- // first week 1 2 3 4 5 6 7 (sum is 28 i.e. 7*(i+3) if i=1)
5
- // second week 2 3 4 5 6 7 8 (sum is 35 i.e. 7*(i+3) if i=2)
+ int m=n/7; //(no.of full weeks)
+ // first week 1 2 3 4 5 6 7 (sum is 28 i.e. 7*(i+3) if i=1)
6
+ // second week 2 3 4 5 6 7 8 (sum is 35 i.e. 7*(i+3) if i=2)
7
//.... so on
8
int res=0; //for result
9
//calculating full weeks
@@ -15,4 +16,4 @@ public int totalMoney(int n) {
15
16
}
17
return res;
18
-}
19
+}
0 commit comments