Cant figure why not working

Hey @abhinavsehgal802_270a44594b6dc4ad,

This problem is a follow up of the Maximum Subarray sum. So it is suggested to solve that first.
You are using an extra memory again and again, thus you can get an out of memory error.

Use this approach to solve the problem.

In this problem, there can be two cases i.e. either the subarray having maximum sum is
obtained in a circular fashion or the subarray having maximum sum is obtained in a non-
circular fashion.

The non-circular maximum sum subarray can be obtained directly by Kadane’s Algorithm.
But the subarray with circular fashion cannot be solved by Kadane’s algorithm. So we need to figure something for this.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.