New update is available. Click here to update.

Last Updated: 6 Dec, 2020

Difficulty: Moderate

```
The first line contains a single integer T representing the number of test cases.
Then T test cases follow.
The first line of test case contains an integer 'N' denoting the length of 'ARR'.
The second line of each test case contains 'N' space-separated integers denoting the elements of 'ARR'.
```

```
For each test case, print the length of the maximum subsegment that you can find by changing only one integer in the given sequence.
```

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

```
1 <= T <= 10
1 ≤ N ≤ 10^5
1 ≤ ARR[i] ≤ 10^9
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Longest Subarray With Zero Sum

Posted: 3 Nov, 2022

Difficulty: Moderate

Randomly Sorted

Posted: 13 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

Popular Interview Problems: