Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numOfKeys = int(input())
- keysTemp = input()
- keys = keysTemp.split()
- numOfDoors = int(input())
- doorsTemp = input()
- doors = doorsTemp.split()
- days = 0;
- for input in keys:
- if int(input) == 1:
- if str(2) in doors:
- days += 1
- elif int(input) == 104:
- if str(103) in doors:
- days += 1
- else:
- for door in doors[:]:
- if int(input) + 1 == int(door) or int(input) - 1 == int(door):
- days += 1
- doors.remove(door)
- print(days)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement