You are viewing a single comment's thread. Return to all 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 😍
Seems like cookies are disabled on this browser, please enable them to open this website
Handshake
You are viewing a single comment's thread. Return to all comments →
BRO! Its just a simple Combination Formula for C(N, 2) = N! / 2( N - 2)! = N ( N -1 )/2
You nailed it, happy coding 😍