Unable to identify the cause of failure as I am getting correct output.