Company: CoinSwitch
Difficulty: medium
Question The current selected programming language is C++. We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted, you cannot review this problem again. You can use cout to debug your code. The code may not work in case of syntax/runtime error. This version of GCC being used is 5.5.0. A restaurant chain has N restaurants. Each restaurant is given a unique ID from 0 to N-1. To establish connectivity among all the restaurants, the head office maintains a hierarchy with N-1 connections. The restaurant with head office is given an ID 0. A restaurant is further connected to a maximum of two restaurants. For every restaurant A, a new restaurant A is always added to the left of it and its left connection is occupied then a restaurant A is added to the right of it. The system maintains the count of permanent customers of every restaurant. An annual festival is being organised in one of the restaurants. To select which restaurant will host