Hi, here atleast 1 cannot be the answer because, in any order we try to execute the 3 processes, say if P0 executes first then after its execution, S1=S2=1, and S0=0, so if P0 executes again since its in while I can execute again, it gets blocked and waiting for someone to releaseS0.
then whenever P1 or P2 get a chance they will not be blocked since S1=S2=1, so they will release S0 and make S0=1,
Now there r 2 cases, either P1 and P2 occur one after the other then finally P0 comes in this case S1=1 only so only once P0 can execute and it will print second 0.
Or P1 then P0 then again P2 then P0, in this way P0 gets two more times to run so total 3 zeros. So anyhow atleast 2 two times its printed.