Not able to pass Test Cases - 1&2


This is the link to my code