• + 0 comments

    Yes, the formula n * (n - 1) / 2 works perfectly for this. It’s just the classic combination logic (C(n, 2)). If anyone’s looking for a simple breakdown of similar problem-solving patterns, you can click here for a quick resource I found useful.