Hackerblocks doubts

https://hack.codingblocks.com/app/practice/5/1021/problem

Please help me regarding this.

Hi u can refer this https://ide.codingblocks.com/s/582385

why is // b[i]=1 here??

i hope u have understood the ques. try to implement on ur own code. this code i gave just for reference

I could not understand what is the purpose of b So please explain it to me,and also if you can brief the logic behind this problem here