Clearing the array
You've got this list of positive numbers. Now, you've got two options to play with this list:
You can pick any two numbers that are the same and remove them from the list.
Alternatively, you can pick any three numbers that are same and remove them from the list.
Your goal is to clear out the entire list using these operations. But here's the catch: you wanna do it in the fewest moves possible!
Now, your task is to figure out the minimum number of moves needed to empty the list completely. And if it's impossible to clear the list, just give up and print -1
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)