tanus786 / CP-Codes-HackOctober-Fest-2023

This repository is for beginners who want to contribution in open source HackOctober Fest 2023
MIT License
141 stars 394 forks source link

Create dice_roll_with_k_face_and_target_sum.cpp #863

Closed kritikarag closed 1 year ago

kritikarag commented 1 year ago

You have n dice, and each die has k faces numbered from 1 to k. Given three integers n, k, and target, return the number of possible ways (out of the kn total ways) to roll the dice, so the sum of the face-up numbers equals target. Since the answer may be too large, return it modulo 109 + 7.