Count Repeated Elements In Array Javascript Length Function In C