← Morgan Stanley questions

Number of Dice Rolls With Target Sum

Filed under Morgan Stanley

You have n dice, and each die has k faces numbered 1 to k. Given three integers n, k, and target, return the number of possible ways (out of k^n total rolls) to roll the dice so the sum of the face up…

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 Morgan Stanley questions

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