0
There is a set of cards numbered from 1 to N. Among this set a card was lost, determine the number of the lost card based on the remaining cards.
Given an N number, followed by N-1 integer values representing the numbers of the remaining cards,.
Input example
5
3
5
2
1
Example of an exit
4
Well this is the exercise, with the help of the comments I arrived at the following code
num1 = int(input())
conj1 = set(range(1, num1+1))
for i in range(1,num1):
valores1 = int(input())
conj2 =
# "aqui está o problema, quero que o conj2 seja um conjunto
# com todos os numeros digitados em valores1 como fazer isso?"
lost = conj1 ^ conj2
Remo, among this mentioned problem, you could share with us what you have tried and where you have doubt?
– Caique Romero
If you have trouble translating from English have a website Português SE where they can help you. Believe these machine translations are very ruims
– jean
So dude, I hadn’t met with a problem like this before. I honestly don’t know where to start. I believe what I need is for him to map from 1 to N, and then print the number that was not entered in this range. but how to do this?
– Remo