# Review Algorithmic Thinking by Building a Dice Game - Step 7

### Tell us what’s happening:

Hello guys.
Technically it works. But the test won’t let it pass. Spent so much time trying to understand what could be wrong. I don’t know what to do anymore. Do you have any clue?
Thanks a lot!

``````<!-- file: index.html -->

``````
``````/* file: styles.css */

``````
``````/* file: script.js */
// User Editable Region

const getHighestDuplicates = (diceList) => {
let arr = [0,0,0,0,0];
let sum = 0;
for(let i=0 ; i < 5 ; i++) {
arr[diceList[i].textContent]++;
sum+=Number(diceList[i].textContent);
}
arr.sort((a,b)=>b-a)
};

if (rolls === 3) {
} else {
rolls++;
rollDice();
getHighestDuplicates(listOfAllDice);
}
});

// User Editable Region
``````

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36`

### Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

Hi and welcome to the forum.

This question has many different posts already that you may want to look at for ideas.

To get you started though, please review the exercise requirement below:

create a `getHighestDuplicates` function which takes an array of numbers.

You have not done this yet because you are not passing in the dice number array. So start there and take a look at some of the posts about this step as well to complete your research.

Thank you so much!!
Sending the listOfAllDice was totally meaningless so I should have noticed this detail…

(for the other guys - I actually had another two mistakes of declaring the counter-arr with only 5 items instead of 6, and of not taking -1 of the dice value when using it as an index)

1 Like