Skip to content

Commit f0694b3

Browse files
add 2652
1 parent 5673ce4 commit f0694b3

File tree

2 files changed

+16
-0
lines changed
  • paginated_contents/algorithms/3rd_thousand
  • src/main/java/com/fishercoder/solutions/thirdthousand

2 files changed

+16
-0
lines changed

Diff for: paginated_contents/algorithms/3rd_thousand/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
| 2670 | [Find the Distinct Difference Array](https://leetcode.com/problems/find-the-distinct-difference-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2670.java) | | Easy |
2323
| 2660 | [Determine the Winner of a Bowling Game](https://leetcode.com/problems/determine-the-winner-of-a-bowling-game/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2660.java) | | Easy |
2424
| 2656 | [Maximum Sum With Exactly K Elements](https://leetcode.com/problems/maximum-sum-with-exactly-k-elements/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2656.java) | | Easy |
25+
| 2652 | [Sum Multiples](https://leetcode.com/problems/sum-multiples/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2652.java) | | Easy |
2526
| 2643 | [Row With Maximum Ones](https://leetcode.com/problems/row-with-maximum-ones/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2643.java) | | Easy |
2627
| 2641 | [Cousins in Binary Tree II](https://leetcode.com/problems/cousins-in-binary-tree-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2641.java) | | Medium |Tree, BFS, HashTable
2728
| 2605 | [Form Smallest Number From Two Digit Arrays](https://leetcode.com/problems/form-smallest-number-from-two-digit-arrays/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2605.java) | | Easy |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.fishercoder.solutions.thirdthousand;
2+
3+
public class _2652 {
4+
public static class Solution1 {
5+
public int sumOfMultiples(int n) {
6+
int sum = 0;
7+
for (int i = 1; i <= n; i++) {
8+
if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) {
9+
sum += i;
10+
}
11+
}
12+
return sum;
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)