Company: Amazon Offcampus Sde intern
Difficulty: medium
Customer Purchase Data George is a software developer who is currently working on a project involving the analysis of customer purchase data. He has been given the purchase data of N customers and an array A which consists of N customer purchase amounts that he must analyze. George must perform the following operations on the customer purchase amounts: He must identify the largest contiguous increasing subarray. He must identify the largest contiguous decreasing subarray. Finally, he needs to find the maximum length between the two subarrays. Your task is to help George find and return an integer value representing the maximum length of the subarray's largest contiguous increasing and decreasing subarray. Note: Contiguous elements are consecutive elements. Input Specification: input1 : An integer value N, denoting the number of customers. input2 : An integer array A of N integers, denoting N customer purchase amounts. Output Specification: Return an integer value representing the maxim