Skip to content

Commit eb0a96a

Browse files
refactor 575
1 parent 43a02af commit eb0a96a

File tree

1 file changed

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

1 file changed

+0
-22
lines changed

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,6 @@
22

33
import java.util.Arrays;
44

5-
/**
6-
* 575. Distribute Candies
7-
*
8-
Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these candies equally in number to brother and sister. Return the maximum number of kinds of candies the sister could gain.
9-
10-
Example 1:
11-
Input: candies = [1,1,2,2,3,3]
12-
Output: 3
13-
Explanation:
14-
There are three different kinds of candies (1, 2 and 3), and two candies for each kind.
15-
Optimal distribution: The sister has candies [1,2,3] and the brother has candies [1,2,3], too.
16-
The sister has three different kinds of candies.
17-
Example 2:
18-
Input: candies = [1,1,2,3]
19-
Output: 2
20-
Explanation: For example, the sister has candies [2,3] and the brother has candies [1,1].
21-
The sister has two different kinds of candies, the brother has only one kind of candies.
22-
Note:
23-
24-
The length of the given array is in range [2, 10,000], and will be even.
25-
The number in given array is in range [-100,000, 100,000].
26-
*/
275
public class _575 {
286
public static class Solution1 {
297
public int distributeCandies(int[] candies) {

0 commit comments

Comments
 (0)