- 2
Given a list of n-1 numbers ranging from 1 to n, your task is to find the missing number. There are no duplicates. Input Forma
7 odpowiedzi
+ 6
Pallab Das run it in sololearn code playground
+ 5
Pallab Das Show your attempt share your code so that it will be helpful to know your problem
+ 2
Do self.
0
Which i do in this it's not run
0
def missing_number(num_list):
return sum(range(num_list[0],num_list[-1]+1)) - sum(num_list)
print(missing_number([1,2,3,4,6,7,8]))
print(missing_number([10,11,12,14,15,16,17]))
0
It's not compile
0
Fail when i run in sololearn code...plz solve this