Rubrik, Previously Asked Coding Questions in IIT-B, November, 2022 | Diwali Celebration | Saving Mondstadt | Xorinngggg! | Sorting Shadows

Rubrik · Question · Posted Nov 2022

Question 1 Diwali Celebration <problem>256</problem> Sameer loves celebrating Diwali. He has decorated his house with N LED lights. Some of these are switched on and some of these are switched off currently. He wants to maximize the total beauty of the decoration. For the i-th light, he gives a beauty score to the light as A[i]. The total beauty of the decoration is the sum of beauty scores of all the lights which are switched on. A p-switch is a ...

The full answer & interview discussion are available to premium members.

Log in Create a free account