Volume Difference

Imagine you have two boxes and need to know how much more space one can hold than the other. Write a function find_difference that takes the dimensions of two cuboids a and b as lists: length, width, and height. Calculate each volume and return the absolute difference between them.

Примеры

Ввод
[3, 2, 5], [1, 4, 4]
Вывод
14
Ввод
[9, 7, 2], [5, 2, 2]
Вывод
106
Ввод
[1, 1, 1], [1, 1, 1]
Вывод
0

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

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

Теги

mathlistsarray
PostgreSQLv16

Här visas resultatet av din kod

Visible tests
1
Input
[3,2,5], [1,4,4]
Expected14
2
Input
[9,7,2], [5,2,2]
Expected106
3
Input
[1,1,1], [1,1,1]
Expected0
4
Input
[2,2,2], [1,1,1]
Expected7
5
Input
[10,10,10], [5,5,5]
Expected875
6
Input
[2,2,2], [1,1,1,1,1]
Expected7
Focus radio
Paused · SomaFM · Fluid