I would recommend that you should downvote and move on if the question or code is of poor quality, often indicated by the lack of formatting, the lack of providing a Minimal, Verifiable, and Complete solution. 

However, if there is a solution or at least a method of getting the asker closer to the solution, just go with a comment, giving tops how to solve, and if necessary, steps to improve their code.