What's wrong with the code

The code was working fine for IDE but here it is showing 1 output wrong do check it out, It’s in collaborate mode hence you can see directly.

hello @luniatarun22
print output for each case in different line