• + 0 comments

    BRO! Its just a simple Combination Formula for C(N, 2) = N! / 2( N - 2)! = N ( N -1 )/2

    int handshakes(int n) {
        return n * (n - 1) / 2;
    }
    

    You nailed it, happy coding 😍