Skip to content

Practice Pizza With 3n Slices

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#1388
LeetCode Problem

Pizza With 3n Slices

Problem Statement

The circular pizza has 3 * n slices whose sizes are listed clockwise in slices. In each round, you choose any remaining slice; Alice then takes the neighboring remaining slice counterclockwise from your choice, and Bob takes the neighboring remaining slice clockwise from your choice. Repeat until the pizza is gone. Return the greatest total size of slices you can obtain.

Source: Pizza With 3n Slices on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
slices = [1,2,3,4,5,6]
Output
10

# Example 2

Input
slices = [8,9,8,6,1,1]
Output
16

Constraints

3 * n == slices.length
1 <= slices.length <= 500
1 <= slices[i] <= 1000

Related LeetCode Problems

Practice more problems similar to Pizza With 3n Slices.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.