Okay so basically all i have to do is find a lost number in sequence.
For the input data:
5
2 3 1 5
The correct answer is
4
def findMissing(n):
tempList = []
for i in range(0, n-1):
tempList.append(str(input()))
return [x for x in range(tempList[0], tempList[-1]+1) if x not in tempList]
findMissing(5)
Output:
---> 11 return [x for x in range(tempList[0], tempList[-1]+1) if x not in tempList]
TypeError: must be str, not int
I've tried something like that, i wanted to create a list, and input would be appearing into that list, then i will return the missing value from that list, but it's not working.