Whats wrong with my logic .i am unable to understand