Login

All Problems

Problem title

Difficulty

Avg time to solve

First Missing Positive

Moderate

18 mins

Maximum Subarray Sum

Hard

35 mins

XOR Query

Moderate

10 mins

Rat In a Maze All Paths

Moderate

40 mins

Reverse Blocks

Hard

56 mins

Sudoku?

Moderate

40 mins

Swap Two Numbers

Easy

10 mins

Flip Bits

Easy

15 mins

Add Two Numbers As Linked Lists ll

Moderate

10 mins

Alien dictionary

Hard

46 mins

Problem

Submissions

146

Avg. time to solve

35 min

Success Rate

81%

Problem Statement

```
The sum of an empty subarray is 0.
```

```
The first line of input contains an integer N, representing the length of the array.
The second line of input contains N single space-separated integers, denoting the elements of the array.
```

```
In the only output line, output the maximum subarray sum.
```

```
You are not required to print the output explicitly, it has already been taken care of. Just implement the function.
```

```
1 <= N <= 10^6
-10^6 <= A[i] <= 10^6
where N is the length of the array.
A[i] represents the numbers present in the array.
Time limit: 1sec
```

```
9
1 2 7 -4 3 2 -10 9 1
```

```
11
```

```
The subarray yielding maximum sum is [1, 2, 7, -4, 3, 2].
```

```
6
10 20 -30 40 -50 60
```

```
60
```

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Language

Change Theme

Solution submission not allowed

Save Code

Reset Code