// I can’t even view the tests so I can’t tell where I’ve made a mistake.
Yes, that is by design. There are things we call “edge cases”, areas on the “edge” of what is “normal” where algorithms may fail. Part of being a developer is thinking about these things and accounting for them. They didn’t tell you what edge case they were testing - they want you to figure it out.
Stop and think where the edge cases might be. For example, if I were doing a function do divide two numbers… What if the divisor is zero? What if the answer is too big? What if one of the numbers is too big, or is
Infinity? What if one of the inputs isn’t a number? Etc. How should it handle each of these?
So, I was able to find a test that failed for your solution. Since we are told:
You are given an array containing the color of each glove.
We know that it will be an array, and since the colors will be strings, we can assume that this will be an array of strings. Let’s also assume that the color strings will be lowercase and there won’t be any spelling variants. What other odd conditions might give the potential for an odd answer? Hint: It’s not something terribly sneaky.
See if you can find it. Check back if you’re still struggling.