Loading...
Loading...
Loading...
A help desk has a list of valid ticket ids. When a customer quotes a ticket id, check whether it is on the list.
Print Valid or Invalid.
Valid if the id is on the list, otherwise Invalid.Example 1
Input
T100 T101 T102 T101
Output
Valid
On the list.
Example 2
Input
T100 T101 T102 T999
Output
Invalid
Not on the list.
Try the problem first. Open one hint at a time.
Checking membership in a set is fast.
Make a set of the valid ids and test the quoted id with in.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor