Not able to figure what is the issue.It is working fine for the testcase given in question