Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save meet100ni/2a511b09996b58ae7351eaf58871cd3d to your computer and use it in GitHub Desktop.
Save meet100ni/2a511b09996b58ae7351eaf58871cd3d to your computer and use it in GitHub Desktop.
The Captain's Room HackerRank Solution
# Enter your code here. Read input from STDIN. Print output to STDOUT
K = int(input())
set_S = set()
sumlist_S = 0
for i in input().split():
I = int(i)
set_S.add(I)
sumlist_S += I
print((sum(set_S)*K - sumlist_S)//(K-1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment