Longest Increasing Subarray After Changing One Element

Asked at Google · Coding & Leetcode-style Questions · Difficulty: Medium

You are given an array of integers. You may change at most one element to any integer you like (negative, zero or positive, with no limit), or leave the array unchanged. After that, find the longest strictly increasing contiguous subarray and report its length. Choose the change that makes this length as large as possible.

Loading the problem…