Showing First two test cases wrong

you code will fail for cases like this
YAmACoder
this is because you have only consider one case (which is given as sample input)

first character can be anything not just only I

Correct way to solve this is attached below
check this and if you have any further doubt feel free to ask

Modified code