bigger_two

Start with 2 int lists, a and b, each length 2. Consider the sum of the values in each list. Return the list which has the largest sum. In event of a tie, return a.

This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.

Test 1

Input:

[1, 2]
[3, 4]

Output:

[3, 4]

Test 2

Input:

[3, 4]
[1, 2]

Output:

[3, 4]

Test 3

Input:

[1, 1]
[1, 2]

Output:

[1, 2]

Test 4

Input:

[2, 1]
[1, 1]

Output:

[2, 1]

Test 5

Input:

[2, 2]
[1, 3]

Output:

[2, 2]

Test 6

Input:

[1, 3]
[2, 2]

Output:

[1, 3]

Test 7

Input:

[6, 7]
[3, 1]

Output:

[6, 7]