This problem taught you the loop-and-count pattern. You repeat a check multiple times, keeping track of how many times the check passes. This pattern appears in countless problems, from filtering data to validating inputs.
I showed you how to simplify complex conditions. Instead of checking all combinations of two friends being sure, you reduce the problem to arithmetic: sum the values and compare to a threshold.
You also learned about the power of if statements in loops. The if controls what happens during each iteration. Sometimes you increment a counter, sometimes you skip, sometimes you modify data.