Php Count Duplicates In Arraylist Sort In Descending Python