Posts

Showing posts from July, 2021

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...

Challenge - #62 - Triangle Quest

  for  i  in   range ( 1 , int ( input ())):  #More than 2 lines will result in 0 score. Do not leave a blank line also      print ((( 10 **i)// 9 )*i)

Challenge - #61 - Integer Comes in All Sizes

  # Enter your code here. Read input from STDIN. Print output to STDOUT a =  int ( input ()) b =  int ( input ()) c =  int ( input ()) d =  int ( input ()) print ((a**b)+ (c**d))

Challenge - #60 - Power-Mod Power

  # Enter your code here. Read input from STDIN. Print output to STDOUT a =  int ( input ()) b =  int ( input ()) m =  int ( input ()) print ( pow (a,b), pow (a,b,m),sep= "\n" )

Challenge - #59 - Mod Divmod

  a =  int ( input ()) b =  int ( input ()) q,r =  divmod (a,b) print (q,r,(q,r),sep= '\n' )

Challenge - #58 - Piling Up!

  # Enter your code here. Read input from STDIN. Print output to STDOUT from  collections  import  deque def  piling(d):      while  d :         large =  None          if  d[ -1 ] > d[ 0 ]:             large = d.pop()          else  :             large = d.popleft()                   if   len (d) ==  0  :              return   "Yes"                 ...

Challenge - #57 - Collections.deque()

# Enter your code here. Read input from STDIN. Print output to STDOUT from  collections  import  deque d = deque() for  i  in   range ( int ( input ())):     inp =  input ()      if  inp ==  "pop" :         d.pop()      elif  inp ==  "popleft" :         d.popleft()      else :         command , value = inp.split()         value =  int (value)          if  command ==  "append" :             d.append(value)          else :  ...