Company: Nvidia_7feb
Difficulty: medium
Fruit Crush Problem Description Amazon recently launched a new game, Fruit Crush! In this game, you are allowed to choose two dissimilar fruits and crush them. Each type of fruit is represented as an integer in an array. Formally you can choose any two unequal integers in the array and delete them. Given an array fruits of size n , return the minimum possible number of fruits left after the given operation is performed any number of times. Complete the function getMinFruits in the editor below. getMinFruits has the following parameter(s): int fruits[n] : array of n fruits Returns int : the minimum possible count of fruits left int getMinFruits(vector fruits) { // Function body will be implemented here } Examples Example 1: Input: n = 5, fruits = [3, 3, 1, 1, 2] Output: 1 Explanation: Fruits 1 (banana) and 2 (pineapple) can be crushed first, followed by numbers 1 (banana) and 3 (orange). Only 3 (orange) remains in the array, hence the answer is 1. Example 2: Input: n = 4, fruits = [1, 2