SHARE
TWEET

Untitled

a guest Jan 25th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. numOfKeys = int(input())
  2. keysTemp = input()
  3. keys = keysTemp.split()
  4. numOfDoors = int(input())
  5. doorsTemp = input()
  6. doors = doorsTemp.split()
  7. days = 0;
  8.  
  9. for input in keys:
  10.     if int(input) == 1:
  11.         if str(2) in doors:
  12.             days += 1
  13.     elif int(input) == 104:
  14.         if str(103) in doors:
  15.             days += 1
  16.     else:
  17.         for door in doors[:]:
  18.             if int(input) + 1 == int(door) or int(input) - 1 == int(door):
  19.                 days += 1
  20.                 doors.remove(door)
  21. print(days)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top