Facing promblem with the Q

This my approach I am not getting all correct can you kindly check my code and tell me the correction