Maximum Sum Circular Subarray

Medium · Dynamic Programming · about 20 minutes

Asked at Amazon, Google, Meta, Microsoft, Bloomberg.

Treat nums as a ring, so the last element is followed by the first. Find the non-empty contiguous stretch around the ring with the biggest total, without using any element twice, and return that total.

Related guides