Skip to content

Commit 1d2cab3

Browse files
refactor 1388
1 parent 6415df4 commit 1d2cab3

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

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

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

33
import java.util.Arrays;
44

5-
/**
6-
* 1388. Pizza With 3n Slices
7-
*
8-
* There is a pizza with 3n slices of varying size, you and your friends will take slices of pizza as follows:
9-
* You will pick any pizza slice.
10-
* Your friend Alice will pick next slice in anti clockwise direction of your pick.
11-
* Your friend Bob will pick next slice in clockwise direction of your pick.
12-
* Repeat until there are no more slices of pizzas.
13-
* Sizes of Pizza slices is represented by circular array slices in clockwise direction.
14-
*
15-
* Return the maximum possible sum of slice sizes which you can have.
16-
*
17-
* Example 1:
18-
* Input: slices = [1,2,3,4,5,6]
19-
* Output: 10
20-
* Explanation: Pick pizza slice of size 4, Alice and Bob will pick slices with size 3 and 5 respectively. Then Pick slices with size 6, finally Alice and Bob will pick slice of size 2 and 1 respectively. Total = 4 + 6.
21-
*
22-
* Example 2:
23-
* Input: slices = [8,9,8,6,1,1]
24-
* Output: 16
25-
* Output: Pick pizza slice of size 8 in each turn. If you pick slice with size 9 your partners will pick slices of size 8.
26-
*
27-
* Example 3:
28-
* Input: slices = [4,1,2,5,8,3,1,9,7]
29-
* Output: 21
30-
*
31-
* Example 4:
32-
* Input: slices = [3,1,2]
33-
* Output: 3
34-
*
35-
* Constraints:
36-
* 1 <= slices.length <= 500
37-
* slices.length % 3 == 0
38-
* 1 <= slices[i] <= 1000
39-
* */
405
public class _1388 {
416
public static class Solution1 {
427
public int maxSizeSlices(int[] slices) {

0 commit comments

Comments
 (0)