Company: Amazon_19sep
Difficulty: medium
Code Question 1 Problem Description An e-commerce partner on Amazon's platform faces an operational challenge due to fluctuations in daily processing needs. To solve this, Amazon allocates a set of n processing facilities, each identified by a unique integer from 1 to n . Amazon selects which processing facility to activate based on comparisons between consecutive days' processing volumes. If the processing volume increases compared to the previous day, Amazon activates a processing facility with a higher identifier. If the processing volume decreases, Amazon activates a processing facility with a lower identifier. If the processing volume remains the same as the previous day, then Amazon activates a processing facility with an identifier equal to the one used on the previous day. The resource allocation cost for the partner is calculated by counting the number of unique processing facilities used. Your task is to determine the minimum number of unique processing facilities that Amazon