# Enter your code here. Read input from STDIN. Print output to STDOUT import re for i in range ( int ( input ())): try : re. compile ( input ()) print ( True ) except : print ( False )
n = int ( input ()) s = set ( map ( int , input ().split())) for i in range ( int ( input ())): inp = input () if inp == "pop" : s.pop() else : command , value = inp.split() if command == "discard" : s.discard( int (value)) else : s.remove( int (value)) print ( sum (s))
#!/bin/python3 import math import os import random import re import sys from datetime import datetime # Complete the time_delta function below. def time_delta(t1, t2): #just this three lines are the answer everything else is already written for you time1 = datetime.strptime(t1, '%a %d %b %Y %H:%M:%S %z' ) time2 = datetime.strptime(t2, '%a %d %b %Y %H:%M:%S %z' ) return str ( int ( abs (time1-time2).total_seconds())) if __name__ == '__main__' : fptr = open (os.environ[ 'OUTPUT_PATH' ], 'w' ) t = int ( input ()) for t_itr in range (t): t1...
Comments
Post a Comment