Greedy approach not clear

The efficient solution at around 1:05:00 is not clear to me . What to do after creating a frequency array ? Please clarify

Nipun plz verify tht the doubt you are asking is related to the question, badness of ranklist or not ?

yes the badness of ranklist problem

Basically, after you create a frequency array, traverse through entire frequency array , until all elements become 0 . You have to take a element which is non zero, subtract its value and then take the value of i from 1 to 7, and then keep on adding the other values, so as to calculate the badness. based on actual and available rank, actual rank is i and available is your freq array values.