Company: oracle_29oct
Difficulty: medium
Trend Detection Problem Description You are given a list of updates made to containers. Each update includes: the container's ID, the time (in seconds) when the update happened, and the new limit value after the change. For each container, look at its update in time order. A container is unstable if, across its updates, its limit value increases at least once and also decreases at least once (in any order). Find how many containers are unstable. Examples Example 1: Input: containerID = ["webapp", "cache", "webapp", "cache", "webapp", "cache"] timestamp = [10, 20, 50, 40, 30, 60] limit = [15, 50, 10, 30, 20, 80] Output: 2 Explanation: Let's analyze the limit trends for each container: For container "webapp": The updates sorted by timestamp are: (10, 15), (30, 20), (50, 10). The limit value sequence is 15 → 20 → 10. From 15 to 20, the limit increases. From 20 to 10, the limit decreases. Since both an increase and a decrease occur, "webapp" is unstable. For container "cache": Th