Wildlife Sanctuary Tour Management

Company: Bounteous × Accolite_23oct

Difficulty: medium

Problem Statement

Wildlife Sanctuary Tour Management Problem Description You manage a wildlife sanctuary whose habitats are numbered along a single trail. Guided tour groups walk the trail: tour group i enters the trail at habitat entryHabitat[i] , walks through every habitat in between, and leaves at habitat exitHabitat[i] . Its route therefore covers every habitat number from entryHabitat[i] to exitHabitat[i] , both ends included . A habitat can host only one tour group at a time, so whenever several routes share a habitat number, that many separate habitats must be open at the same time to keep the groups apart. Return the minimum number of habitats that must be available at the same time so that every tour group can complete its route. This equals the largest number of routes that all contain one common habitat number. Function Description Complete the function minimumHabitats . Parameters: entryHabitat (int[n]): entryHabitat[i] is the habitat where tour group i enters. exitHabitat (int[n]): exitHab