Score the Triplets

Alice and Bob each have three scores, and each position should be compared separately. The function compare_the_triplets receives two lists, a and b: if a[i] is greater, Alice gets a point; if it is smaller, Bob gets a point; if they are equal, nobody gets a point. Return a list of two numbers: Alice’s score first, then Bob’s score.

Примеры

Ввод
[5, 6, 7], [3, 6, 10]
Вывод
[1, 1]
Ввод
[17, 28, 30], [99, 16, 8]
Вывод
[2, 1]
Ввод
[1, 1, 1], [1, 1, 1]
Вывод
[0, 0]

Нужно реализовать

def compare_the_triplets(a: list[int], b: list[int]) -> list[int]:

Теги

arraymath
PostgreSQLv16

Šeit parādīsies koda izpildes rezultāts

Visible tests
1
Input
[5,6,7], [3,6,10]
Expected[1,1]
2
Input
[17,28,30], [99,16,8]
Expected[2,1]
3
Input
[1,1,1], [1,1,1]
Expected[0,0]
4
Input
[10,20,30], [1,2,3]
Expected[3,0]
5
Input
[1,2,3], [10,20,30]
Expected[0,3]
6
Input
[5,6,7,5], []
Expected[0,0]
Focus radio
Paused · SomaFM · Fluid