Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3576b52

Browse files
author
Steve Sun
committed
add 2177
1 parent 6f3aa31 commit 3576b52

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|---------------|--------|-------------|-------------
11+
| 2177 |[Find Three Consecutive Integers That Sum to a Given Number](https://leetcode.com/problems/find-three-consecutive-integers-that-sum-to-a-given-number/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2177.java) ||Medium||
1112
| 2176 |[Count Equal and Divisible Pairs in an Array](https://leetcode.com/problems/count-equal-and-divisible-pairs-in-an-array/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2176.java) ||Easy||
1213
| 2169 |[Count Operations to Obtain Zero](https://leetcode.com/problems/count-operations-to-obtain-zero/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2169.java) ||Easy||
1314
| 2166 |[Design Bitset](https://leetcode.com/problems/design-bitset/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2166.java) ||Medium||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2177 {
4+
public static class Solution1 {
5+
public long[] sumOfThree(long num) {
6+
long remainder = num % 3;
7+
long ave = num / 3;
8+
if (remainder == 0) {
9+
return new long[]{ave - 1, ave, ave + 1};
10+
} else {
11+
return new long[]{};
12+
}
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)