what's wrong with this solution i tried many inputs program gives correct output in each case but still last condition fails to satisfy ?