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

### Tell us what’s happening:

I’ve been stuck on this one for ages and cant seem to find an answer online either. Could anyone point in the right direction or tell me which bit is wrong?

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

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

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

// Example usage when dice are rolled
if (rolls === 3) {
} else {
rolls++;
rollDice();
getHighestDuplicates(diceValuesArr);
}
});
const getHighestDuplicates = (arr) => {
const counts = {};

// Count occurrences of each number in the array
for (const num of arr) {
counts[num] = (counts[num] || 0) + 1;
}

let highestCount = 0;

// Determine the highest count of any number
for (const count of Object.values(counts)) {
if (count > highestCount) {
highestCount = count;
}
}

const sumOfAllDice = arr.reduce((a, b) => a + b, 0);

// Update radio options based on the highest duplicate count
if (highestCount >= 4) {
updateRadioOption(1, sumOfAllDice); // Four of a Kind
} else if (highestCount >= 3) {
updateRadioOption(0, sumOfAllDice); // Three of a Kind
} else {
}
};

// Example usage when dice are rolled
if (rolls === 3) {
} else {
rolls++;
rollDice();
getHighestDuplicates(diceValuesArr);
}
});

// User Editable Region
``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36`