Company: Bounteous × Accolite_23oct
Difficulty: medium
Wildlife Sanctuary Tour Management Problem Description You are the manager of a wildlife sanctuary that provides guided tours through different habitats. Each tour group has a specific route they will follow, passing through various habitats. Each habitat can only accommodate one tour group at a time. You are given two arrays: entryHabitat[] and exitHabitat[] , which denote the habitats each tour group will enter and exit from, respectively. Your task is to determine the minimum number of habitats that must be available at the same time to ensure that all tour groups can complete their routes. Examples Example 1: Input: entryHabitat[] = {1, 2, 3, 1, 4, 5} exitHabitat[] = {3, 4, 5, 2, 6, 7} Output: 3 Explanation: 1. The first tour group enters at habitat 1 and exits at habitat 3. 2. The second tour group enters at habitat 2 and exits at habitat 4. 3. The third tour group enters at habitat 3 and exits at habitat 5. 4. The fourth tour group enters at habitat 1 and exits at habitat 2. 5. T