Posts

Showing posts with the label gyaani coder blog

Challenge - #64 - The Caption's Room

  # Enter your code here. Read input from STDIN. Print output to STDOUT k =  int ( input ()) lst =  list ( map ( int , input ().split())) s1 =  set ()  # unique room no list s2 =  set ()  # room no which appear more than once for  i  in  lst:      if  i  in  s1:         s2.add(i)      else :         s1.add(i) s = s1.difference(s2) print (*s)

Challenge - #63 - Set Mutations

  def  updateit(setA,s,command):      if  command ==  "update" :         setA.update(s)      elif  command ==  "difference_update" :         setA.difference_update(s)      elif  command ==  "intersection_update" :         setA.intersection_update(s)      else  :         setA.symmetric_difference_update(s)      return  setA a =  int ( input ()) setA = set ( map ( int , input ().split())) for  i  in   range ( int ( input ())):     command, len_of_set =  input ().split()     s =  set ( map ( int , input ().split()))     setA = updateit(setA,s,comma...