Let's Play Crush Fruit Together :)
Breaking! πππ₯π₯ Amazon has recently introduced an exciting new game called πππLet's Play Crush Fruit Togetherππ₯π₯! In this game, players can select any two distinct types of fruits and crush them together. Each fruit type is represented as a unique integer within an array.
Your task is to determine the minimum possible number of fruits remaining after repeatedly performing this operation. That means, as long as there exist at least two different fruit types in the array, you can keep picking and removing them.
Complete the function getMinimumFruits in the editor.
getMinimumFruits has the following parameter(s):
int fruitsArray[n]: an array of n integers where each integer represents a specific type of fruit.Returns The function should return a single integer, which represents the smallest number of fruits left in the array after performing the "crush operation" as many times as possible.
1Example 1

2Example 2
Constraints
Limits and guarantees your solution can rely on.
1 <= n <= 10^51 <= fruitsArray[i] <= 10^9