Načítava sa úloha…
Sometimes nearby values matter more as pairs than as separate elements, like sales totals for two neighboring days. The function pairwise_sums receives a list of numbers nums and returns a list of sums of adjacent elements. If the list has fewer than two numbers, there is nothing to add, so return an empty list.
[1, 2, 3][3, 5][5][][][]def pairwise_sums(nums: list[int]) -> list[int]:
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť sa[1,2,3][3,5][5][][][][1,2,3,4][3,5,7][-1,1,-1][0,0][2,3,4][5,7]