At the top is an organization (O). A customer can have more than one organization. Each organization can have multiple sites (s1, s2) and each of those sites can have multiple cameras (c1,c2)
We have a fault detection system that can generate a stream of alarms if a fault is detected. The fault can occur at any level. We would like to filter the alerts.
Please write a function that takes a stream of such alerts as an array and returns an array after removing all alerts which can be rolled up at a higher level.
Input : Input : [ "o1/s1/c1" , "o1/s1/c2" , "o1/s2/c2", "o1/s1"]
Output: ["o1/s1", "o1/s2/c2"]
Comments (5)


