Skip to content

Commit 6e473a5

Browse files
fix build for 888
1 parent ae2030f commit 6e473a5

File tree

1 file changed

+7
-12
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+7
-12
lines changed

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

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,21 @@ public int[] fairCandySwap(int[] A, int[] B) {
4242
int aSum = 0;
4343
int bSum = 0;
4444
int diff = 0;
45-
int [] ans = new int [2];
46-
for(int bar : A)
47-
{
45+
int[] ans = new int[2];
46+
for (int bar : A) {
4847
aSum += bar;
4948
}
50-
for(int bar : B)
51-
{
49+
for (int bar : B) {
5250
bSum += bar;
5351
}
5452
diff = aSum - bSum;
5553
HashSet<Integer> set = new HashSet<>();
56-
for(int bar : A)
57-
{
54+
for (int bar : A) {
5855
set.add(bar);
5956
}
60-
for(int bar : B)
61-
{
62-
if(set.contains(bar + diff/2))
63-
{
64-
ans[0] = bar + diff/2;
57+
for (int bar : B) {
58+
if (set.contains(bar + diff / 2)) {
59+
ans[0] = bar + diff / 2;
6560
ans[1] = bar;
6661
break;
6762
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy