Sasken Interview Question

basic dsa quetion using boolean