25
5
Non-overlapping Matrix Sum Given k arrays of length n , output the maximum sum possible using one element from each array such that no two elements are from the same index. It is guaranteed that k<=n. Input A nonempty list of nonempty arrays of integers. Output An integer that represents the maximum sum. Examples Input -> Output [[1]] -> 1 [[1, 3], [1, 3]] -> 4 [[1, 4, 2], [5, 6, 1]] -> 9 [[-2, -21],[18, 2]] -> 0 [[1, 2, 3], [4, 5, 6], [7, 8, 9]] -> 15 [[1, 2, 3, 4], [5, 4, 3, 2], [6, 2, 7, 1]] -> 16 [[-2, -1], [-1, -2]] -> -2
code-golf array-manipulation
share | improve this question
edited Dec 18 at 15:36
...