Digit Sum

Asked at BNY Mellon · Coding Questions · Difficulty: Medium

There is a lottery with `c` coupons and `p` participants. Each participant picks exactly one coupon. Coupons are numbered from `lowLimit` to `highLimit`, inclusive. The winner of the lottery is any participant who owns a coupon with the sum of digits `s` written on it. If there is more than one winner, then the prize is split equally among them.

Loading the problem…