Skip to content

Commit 2844116

Browse files
refactor 888
1 parent 3a1081f commit 2844116

File tree

1 file changed

+0
-34
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-34
lines changed

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

-34
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,6 @@
22

33
import java.util.HashSet;
44

5-
/**
6-
* 888. Fair Candy Swap
7-
*
8-
* Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j]
9-
* is the size of the j-th bar of candy that Bob has.
10-
*
11-
* Since they are friends, they would like to exchange one candy bar each so that after the exchange, they both have the
12-
* same total amount of candy. (The total amount of candy a person has is the sum of the sizes of candy bars they have.)
13-
*
14-
* Return an integer array ans where ans[0] is the size of the candy bar that Alice must exchange, and ans[1] is the
15-
* size of the candy bar that Bob must exchange.
16-
*
17-
* If there are multiple answers, you may return any one of them. It is guaranteed an answer exists.
18-
*
19-
*
20-
*
21-
* Example 1:
22-
*
23-
* Input: A = [1,1], B = [2,2]
24-
* Output: [1,2]
25-
* Example 2:
26-
*
27-
* Input: A = [1,2], B = [2,3]
28-
* Output: [1,2]
29-
* Example 3:
30-
*
31-
* Input: A = [2], B = [1,3]
32-
* Output: [2,3]
33-
* Example 4:
34-
*
35-
* Input: A = [1,2,5], B = [2,4]
36-
* Output: [5,4]
37-
*/
38-
395
public class _888 {
406
public static class Solution1 {
417
public int[] fairCandySwap(int[] A, int[] B) {

0 commit comments

Comments
 (0)