Company: Accolite_11oct
Difficulty: medium
Festival of Spirits - Eywa's Festival Problem Description In the mystical world of Pandora, the Na'vi tribes live in harmony with the life force of Eywa. They have N sacred sites, numbered from 0 to N-1, connected by pathways with the Great Tree at site 0 at the center. When new sacred sites are discovered, they are added to this network, favoring a connection to the left. If the left is occupied, they connect to the right instead. The Na'vi keep track of the number of guardians at each site in the Book of Souls. For the upcoming Eywa Festival, the Na'vi need to choose the perfect site for the celebration. They use a special number, M, to determine this site through a specific traversal of the network. This hallowed traversal respects the order of connecting to the left first, then the site itself, and finally the right. The chosen Mth site, revealed through this hallowed traversal, will host the festival, its guardian count ensuring a gathering resonant with Eywa's energy and peace. W