parameters: (self, scores, ages)
return_statement: return segment_tree.query(0, len(lookup)-1)
docstring: :type scores: List[int]
          :type ages: List[int]
          :rtype: int
docstring_summary: :type scores: List[int]
          :type ages: List[int]
          :rtype: int
docstring_tokens: : type scores : List [ int ] : type ages : List [ int ] : rtype : int
function: def bestTeamScore(self, scores, ages):
          """
          :type scores: List[int]
          :type ages: List[int]
          :rtype: int
          """
          players = sorted(zip(scores, ages))
          sorted_ages = sorted(set(ages))
          lookup = {age:i for i, age in enumerate(sorted_ages)}  # coordinate compression
          segment_tree = SegmentTree(len(lookup))
          result = 0
          for score, age in players:
              segment_tree.update(lookup[age], lookup[age], segment_tree.query(0, lookup[age])+score)
          return segment_tree.query(0, len(lookup)-1)
function_tokens: def bestTeamScore ( self , scores , ages ) : players = sorted ( zip ( scores , ages ) ) sorted_ages = sorted ( set ( ages ) ) lookup = { age : i for i , age in enumerate ( sorted_ages ) } # coordinate compression segment_tree = SegmentTree ( len ( lookup ) ) result = 0 for score , age in players : segment_tree . update ( lookup [ age ] , lookup [ age ] , segment_tree . query ( 0 , lookup [ age ] ) + score ) return segment_tree . query ( 0 , len ( lookup ) - 1 )