Created
March 3, 2018 14:43
-
-
Save qkreltms/f659192f2f01966f8ade3879d98c8b7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def baekjoon11399(length, times_to_wait_in_line): | |
times_to_wait_in_line.sort() | |
cal = sum(times_to_wait_in_line) | |
result = cal | |
for i in range(length - 1, 0, -1): | |
cal -= times_to_wait_in_line[i] | |
result += cal | |
return result | |
assert(baekjoon11399(5, [3,1,4,3,2]) == 32) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment