Computing Gini Impurity for Classification Labels - Coding problem | OneNoughtOne