class Solution:
def calculateEntropy(self, input: List[int]) -> float:
import math
n = len(input)
x = {}
Entropy = 0
for i in range(0,n):
if input[i] not in x.keys():
x[input[i]] = 1
else:
x[input[i]] += 1
for key in x.keys():
p = x[key]/n
Entropy += -p*math.log2(p)
return Entropy