Tuesday, December 27, 2022

MFIB- All Unique or Not

Fill in the blanks with code so that the program accepts a list of integers and prints YES if all the integers in the list are unique. Else the program prints NO as the output.

Input Format:

The first line contains the list of integers separated by a space.

Output Format:

The first line contains YES or NO.

Example Input/Output :

7893

YES


Solution:


numList=list(map(int,input().split()))

if len(numList)==len(set(numList)):

    print("YES")

else:

    print("NO")

No comments:

Post a Comment

MFIB Comma Separated Integers

Fill in the blanks with code so that the program must accept three integers separated by a space and print them separated by a comma as the ...