Gamified challenge · Asked in Capgemini
Each card shows a few copies of one shape in one color, written as "shape color count", like "circle red 3" (shapes circle, square, triangle, star; colors red, blue, green, yellow; counts 1 to 4). One card is the odd one out: for some attribute, all the other cards share one value and this card has a different one.
Write oddOneOut(figures) (odd_one_out in Python) that returns its index, counting from 0. For ["circle blue 2", "square blue 1", "triangle red 3", "star blue 4"] that's 2: it's the only card that isn't blue.
This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.
Sign in with Google