2870. Minimum Number of Operations to Make Array Empty
You are given a 0-indexed array
numsconsisting of positive integers.There are two types of operations that you can apply on the array any number of times:
- Choose two elements with equal values and delete them from the array.
- Choose three elements with equal values and delete them from the array.
Return the minimum number of operations required to make the array empty, or
-1if it is not possible.