Missing Number

Imagine one number was accidentally lost from the full sequence 1 to n. You are given a shuffled list nums of length n - 1 containing the remaining numbers. Return the missing number.

Примеры

Ввод
[1, 2, 4, 5], 5
Вывод
3
Ввод
[2, 3], 3
Вывод
1
Ввод
[1, 2], 3
Вывод
3

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

def find_deleted(nums: list[int], n: int) -> int:

Теги

arraymath
PostgreSQLv16

Tady se objeví výsledek běhu kódu

Visible tests
1
Input
[1,2,4,5], 5
Expected3
2
Input
[2,3], 3
Expected1
3
Input
[1,2], 3
Expected3
4
Input
[], 1
Expected1
5
Input
[3,7,1,2,8,4,5,6,9], 10
Expected10
6
Input
[1,2,4,5], 1
Expected-11
Focus radio
Paused · SomaFM · Fluid