0 out of 464 challenges solved
Write a Python function `max_sum_list` that takes a list of lists of integers as input and returns the list whose sum of elements is the highest. If there are multiple lists with the same maximum sum, return the first one encountered. #### Example Usage ```python [main.nopy] print(max_sum_list([[1, 2, 3], [4, 5, 6], [10, 11, 12], [7, 8, 9]])) # Output: [10, 11, 12] print(max_sum_list([[3, 2, 1], [6, 5, 4], [12, 11, 10]])) # Output: [12, 11, 10] print(max_sum_list([[2, 3, 1]])) # Output: [2, 3, 1] ``` #### Constraints 1. The input will always be a list of lists of integers. 2. Each inner list will contain at least one integer. 3. The input list will contain at least one inner list.
def max_sum_list(lists): """ Returns the list in a list of lists whose sum of elements is the highest. Args: lists (list of list of int): A list containing lists of integers. Returns: list of int: The list with the highest sum of elements. """ # Your code here pass