"Paying up" question from codechef

Sir, in the paying up problem, This is algo given
Start

Take in the value of ‘n’ and the required value of sum ‘m’

Take in all the values for the banknotes in array ‘d[]’

For i = 1 and i < (2^n)

sum = 0

For j = 0 and j < n

if jth bit of i is set

sum = sum + d[j]

if sum equals m

print Yes and return

Print No and return

they say jth bit of i is set, then take sum… I can understand but cant code it, can you please end me a solution for it ?

this is the sol… tell me if you dont understand anything…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.