Finding Colours - Part 1: This should be easy...right?

1 · Colin McCulloch · July 3, 2022, 11 p.m.
During the interview for my current previous job, I was given a small pair-programming coding challenge to complete. Like all good coding challenges, it was probably beyond what could reasonably have been finished in an hour but it was fun and I got the job so my attempt couldn't have been too bad. Not finishing the challenge did annoy me though so here's my attempt at a more polished version of the challenge...