New update is available. Click here to update.

Last Updated: 29 Sep, 2020

Difficulty: Easy

```
The first line of input contains two integers 'M', and 'N', where 'M' denotes the number of rows and 'N' denotes the number of fans waiting in the line to get a ticket.
The second line contains 'M' single space-separated integers where 'VACANT_SEATS[i]' denotes the number of seats initially empty in the ith row.
```

```
For each output, print a single integer denoting the maximum pounds the club will earn.
```

```
You do not need to print anything, it has already been taken care of. Just implement the given function.
```

```
1 <= 'M' <= 5 * 10^5
1 <= 'N' <= 10^9
1 <= 'VACANT_SEATS[i]' <=10^9
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Longest Subarray With Zero Sum

Posted: 3 Nov, 2022

Difficulty: Moderate

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Ninja And The Strictly Increasing Array

Posted: 27 Nov, 2022

Difficulty: Moderate

Negative To The End

Posted: 16 Dec, 2022

Difficulty: Easy

Sort 0s, 1s, 2s

Posted: 24 Dec, 2022

Difficulty: Easy

Popular Interview Problems: