Cards, bags and coins Problem

I ma getting WA…
Can anybody tell me what will be the output if card number is ‘0’. Or if 2 cards have the same number?

u cant ask such ques here…it is a ques of an ongoing contest…!!!

1 Like
//