go back

Hit the lottery

codeforces: https://codeforces.com/problemset/problem/996/A

The problem states you have n rupee and have a1, a2, a3 ... denominations


The thing I liked about this problem is representation. We can represent the problem in this mathematical way.

a1*x1 + a2*x2 + a3*x3 + .... + am*xm = n

We already have a1, a2,... we need to find Summation (x1 to xm)

#problem-solving #algo #ds
Copyright © 2021 Bisvarup Mukherjee
counter freeViews