Count the handshakes among N people when nobody shakes hands with their own team.
Unlock detailed company stats for this questionUpgrade
At a company event, N people are in a room. Each person shakes hands with every other person exactly once, except that people do not shake hands with members of their own team. Given the total number of people N and an array of team sizes, find the total number of handshakes. Examples: N = 4, teams = [2, 2]; N = 7, teams = [1, 3, 3].
Format · Technical interview.
Community answers
No answers contributed by the community yet.


