If A [ ] is of the form ... .111
if ( count > 0 ) : NEW_LINE INDENT value = count NEW_LINE for j in range ( 1 , count + 1 ) : NEW_LINE INDENT freq [ j ] += value NEW_LINE value -= 1 NEW_LINE DEDENT DEDENT return freq NEW_LINE