← Questions

Longest non-decreasing subarray after changing one element

0
GoogleCodingLast asked Aug 2026
  1. Warm-up: return the length of the longest run of consecutive elements that is strictly increasing.
  2. Given an integer array, return the longest contiguous non-decreasing subarray you can get after changing at most one element to any integer you like (or changing none).
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding