What's wrong with this CODE (HEADBOB)

Here is my code: CodeChef: Practical coding for everyone
The expected output is also produced. The output format is also correct. Please help me with the code.
Thanks a lot!

Well you are missing the case when the both Yand I is there . Then it should be an Indian . In case of NIY , the person must be Indian but your program outputs it as NOT SURE.

1 Like

Solved at: Solution
The main logic is:
N I Y Result
1 1 0 Indian
1 0 1 !Indian
1 0 0 !Sure
0 1 0 Indian
0 0 1 !Indian

Also N doesn’t contribute to answer . it will fail at II also because your all co ditions check for N.