C++20 sections · 1024 units
Open in Course

Team - The Idea

Sum and compare

Here's the trick: add up the three values for each problem. Since each value is either 00 or 11, the sum tells you how many friends are sure. If the sum is at least 22, the team can solve that problem.

I'll show you the pattern. For each problem, read three integers a, b, c. Compute sum = a + b + c. Then check: is sum >= 2? If yes, increment your counter. This pattern shows up everywhere in programming: reduce multiple values to a single number, then make a decision based on that number.

You're converting a complex question into simple arithmetic.