Why 2 test cases are not passed

what is wrong in the given code
3 test cases are passed and 2 test cases are not passed

Hello @the.shubham.sri,

There are few mistakes in your code.
I have corrected it:


Refer to comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.