Sum Between Bounds

Sometimes you need to quickly add all numbers between two boundaries, even if the boundaries arrive in the opposite order. Write get_sum, which takes two integers a and b and returns the sum of every integer from the smaller one to the larger one, inclusive. If the two numbers are equal, just return that number.

Примеры

Ввод
1, 0
Вывод
1
Ввод
1, 2
Вывод
3
Ввод
0, 1
Вывод
1

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

def get_sum(a: int, b: int) -> int:

Теги

math
PostgreSQLv16

Hawn jidher ir-riżultat tat-tħaddim tal-kodiċi

Visible tests
1
Input
1, 0
Expected1
2
Input
1, 2
Expected3
3
Input
0, 1
Expected1
4
Input
1, 1
Expected1
5
Input
-1, 0
Expected-1
6
Input
-1, 2
Expected2
Focus radio
Paused · SomaFM · Fluid