0 out of 464 challenges solved
Write a Python function `max_length` that takes a list of lists as input and returns a tuple containing the length of the longest list and the longest list itself. If there are multiple lists with the same maximum length, return the first one encountered. #### Example Usage ```python [main.nopy] print(max_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])) # Output: (3, [13, 15, 17]) print(max_length([[1], [5, 7], [10, 12, 14, 15]])) # Output: (4, [10, 12, 14, 15]) print(max_length([[5], [15, 20, 25]])) # Output: (3, [15, 20, 25]) ``` #### Constraints - The input will always be a list of lists. - Each sublist will contain only integers. - The input list will not be empty.
def max_length(list_of_lists): """ Find the longest list in a list of lists and return its length and the list itself. Args: list_of_lists (list of list): A list containing sublists. Returns: tuple: A tuple containing the length of the longest list and the list itself. """ # Placeholder for the solution pass