Given a galaxy with planetary systems of varying heights, calculate the maximum height of the galaxy using recursion.
Explanation: Step-by-step: for galaxy {'A': {'B': 2, 'C': 1}, 'B': {'D': 0}, 'C': {}}, we calculate the maximum height of 'A' as 1 + max(height of 'B', height of 'C') = 1 + max(2, 1) = 3.
Explanation: Step-by-step: for galaxy {'Y': {'Z': 0}}, we calculate the maximum height of 'Y' as 1 + 0 = 1.
Master coding challenges related to Recursion and solve the [Backup] Galaxy Height Mapper problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak