← Back to challenges

Find the Largest Numbers in a Group of Lists

PythonHardarrayssortingloopsnumbers

Instructions

Create a function that takes a list of lists with integers or floats. Return a new (single) list with the largest numbers from each.

Examples

findLargestNums([[4, 2, 7, 1], [20, 70, 40, 90], [1, 2, 0]]) ➞ [7, 90, 2]

findLargestNums([[-34, -54, -74], [-32, -2, -65], [-54, 7, -43]]) ➞ [-34, -2, 7]

findLargestNums([[0.4321, 0.7634, 0.652], [1.324, 9.32, 2.5423, 6.4314], [9, 3, 6, 3]]) ➞ [0.7634, 9.32, 9]

Notes

Watch out for negative integers (numbers).

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Spelling it Out