List of Lists

Problem Statement

You are given a list of lists. Find the list whose sum of elements is the highest.

Sample Input
Sample Output

Solution

file_type_python list_of_lists.py
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
print(*max(l, key=sum))

Comments

Load Comments