What does the mask represent?

In this question, what does the mask represent?

mask represent the nos we have taken

Ya, I get that…but can you explain me the overall approach that we are using , like I get the point ki we are using mask to generate possible combinations of numbers. but how are we using mask to procced futher and obtain our answer?

there is also a video in which sir has explain the complete code of this problem

it will be hellpful for you
video name DPBIT - VipulandModulos - Hackerblocks [Code]