I can"t understand the error, i feel my code is correct. In fact i took the solution for this from its answer key

hey @Kamyanagpal
please give correct custom input