Company: Amazon_4_Jan
Difficulty: medium
Longest Arithmetic Subarray With One Change Longest Arithmetic Subarray With One Change Problem Description At Amazon, a team of product analysts is studying the delivery deviation pattern for n customer orders in the Amazon Fresh service. Each product's delivery record is represented by a deviation value, a positive or negative integer stored in the array deviation , where a negative value indicates an early delivery and a positive value indicates a delay. To improve consistency, analysts are allowed to adjust (reschedule) the deviation value of at most one product. Your task is to find the longest possible subarray of deviation such that the difference between consecutive elements in that subarray is constant (i.e., the subarray forms an arithmetic progression). Note: An arithmetic progression is a sequence of numbers such that the difference between the consecutive terms of the sequence is constant. Any sequence with one or more elements is considered an arithmetic progression. A su