Company: Uber_13aug
Difficulty: medium
Biohazard Coexistence Intervals Problem Description A biological researcher is studying bacteria interactions where certain bacteria are poisonous to others. The samples are arranged consecutively in a row numbered from 1 to n . Given lists detailing which bacteria are poisonous to others, your task is to determine the number of intervals within the row that contain only samples capable of coexisting. You are given three parameters: int n : The number of unique bacteria types, also representing the total number of samples arranged in a row from 1 to n . int allergic[m] : An array where allergic[i] represents a bacterium that is allergic to poisonous[i] . int poisonous[m] : An array where poisonous[i] represents a bacterium that is toxic to allergic[i] . A pair of bacteria (A, B) cannot coexist if A is poisonous to B, or B is poisonous to A. An interval [start, end] (inclusive) is considered "valid" if no two bacteria within that interval are poisonous to each other. Your goal is to cou