Introduction to Sets

  • + 0 comments
    def average(array):
        # your code goes here
        distinct_height = set(array)
        sum_of_arr = sum(distinct_height)
        avg = sum_of_arr / len(distinct_height)
        return avg
    
    if __name__ == '__main__':
        n = int(input())
        arr = list(map(int, input().split()))
        result = average(arr)
        print(result)