def compare(a, b):
    """Sort an array of persons with comparator.

    Comparator:
      - If scores are equal, compare names.
      - If a.score is higher than b.score, a should appear first.
      - Vice versa.
    """
    if a.score == b.score:
        return a.name < b.name
    return b.score - a.score < 0