Answer to Question #233894 in Python for Lovely

Question #233894

Smallest Missing Number


Given a list of numbers, write a program to print the smallest positive integer missing in the given numbers.


Input


The input will be a single line containing numbers separated by space.

Help me to do this not coimg correcr answer


1
Expert's answer
2021-09-06T13:17:05-0400
def findSmallestMissingNumber(numbers):
    counter = 1
    numbersSet = set(numbers)
    while counter in numbersSet:
        counter += 1
    return counter




numbers = input().split()
for i in range(len(numbers)):
    numbers[i] = int(numbers[i])
print(findSmallestMissingNumber(numbers))





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS