






"""simple docstring"""


def    lowerCAmelCase							(       __UpperCamelCase					):




  """simple docstring"""







  if not isinstance(__UpperCamelCase						,			__UpperCamelCase					) or not all(
      isinstance(__UpperCamelCase						,			__UpperCamelCase					) and item >= 0 for item in citations					):
    raise ValueError('''The citations should be a list of non negative integers.'''					)

  citations.sort()
  __A		     =					len(__UpperCamelCase					)

  for i in range(__UpperCamelCase					):
    if citations[len_citations - 1 - i] <= i:
      return i

  return len_citations


if __name__ == "__main__":
       import doctest

       doctest.testmod()





"""simple docstring"""


def        __a (		A     ,					A   ):






     '''simple docstring'''



     lowercase__								=				sorted(A     ,					key=lambda A   : value[2]     ,					reverse=A   )

     # Create a list of size equal to the maximum deadline
     # and initialize it with -1
     lowercase__								=				max(A     ,					key=lambda A   : value[1]   )[1]
     lowercase__								=				[-1] * max_deadline

     # Finding the maximum profit and the count of jobs
     lowercase__								=				0
     lowercase__								=				0
     for job in jobs:
          # Find a free time slot for this job
          # (Note that we start from the last possible slot)
          for i in range(job[1] - 1     ,					-1     ,					-1   ):
               if time_slots[i] == -1:
                    lowercase__								=				job[0]
                    count += 1
                    max_profit += job[2]
                    break
     return [count, max_profit]


if __name__ == "__main__":
 import doctest

 doctest.testmod()




