Ritika wants to buy a new laptop. However, she is confused about which laptop to buy out of 10 different laptops. She as
Posted: Tue May 24, 2022 8:18 am
Ritika wants to buy a new laptop. However, she is confused about which laptop to buy out of 10 different laptops. She asks her N friends for their recommendation. The ith friend recommends her to buy the Ath laptop (1 ≤ A, ≤10). She will buy the laptop which is recommended by maximum number of friends. Formulate a program to determine which laptop she buys. If there are multiple laptops having maximum number of recommendations, that is, say laptop id 2 and 9 both have 3 votes then print confused. Sample input1: Laptop id 5 has 6 recommendations Sample Output1: Ritika buys laptop number 5. Sample input2: Laptop id 3, 4 and 7 each has 3 recommendations Sample Output2: Ritika is confused. [10M]