Skip to content

Commit 80a79f6

Browse files
fix build
1 parent 2ab8d55 commit 80a79f6

File tree

1 file changed

+6
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+6
-2
lines changed

src/main/java/com/fishercoder/solutions/_220.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,15 @@ public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
4343
for (int i = 0; i < nums.length; ++i) {
4444
// Find the successor of current element
4545
Integer s = set.ceiling(nums[i]);
46-
if (s != null && s <= nums[i] + t) return true;
46+
if (s != null && s <= nums[i] + t) {
47+
return true;
48+
}
4749

4850
// Find the predecessor of current element
4951
Integer g = set.floor(nums[i]);
50-
if (g != null && nums[i] <= g + t) return true;
52+
if (g != null && nums[i] <= g + t) {
53+
return true;
54+
}
5155

5256
set.add(nums[i]);
5357
if (set.size() > k) {

0 commit comments

Comments
 (0)