← Microsoft questions

Number of ways to get sum X with n dice

Filed under Microsoft

Given n dice each with m faces (numbered 1 to m), find the total number of ways to obtain a target sum X when all n dice are thrown.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.