Score a Yahtzee-style roll.
Read 5 dice values (1..6) on one line, space-separated.
Print the score: if 3 or more of the same value, score = sum of all matching dice; else 0.
If multiple values qualify, sum scores from each.
Test input: 5 5 5 2 3
Expected output: 15
Test logic:
4 4 4 4 1 -> 16
6 6 1 1 1 -> 3
2 3 4 5 6 -> 0
Sign in to save your code and track progress across devices.