One can close as a duplicate _and_ still be helpful and welcoming to a brand new OP.  

When faced with this situation, instead of diving straight into the duplicate closure, I'll instead first locate the duplicate, and in particular a specific answer on the dupe and grab its `share` link.

Then I manually leave a comment to the effect of:

> There's an answer [over here] which seems like it would suit your needs quite well.  This is a question that comes up frequently around here.

Then, I close as a duplicate. Other closevoters see the close count, and eventually when the question is closed, the normal duplicate banner goes to the top.

The OP gets a warm and welcoming comment instead of the robotic

> possible duplicate of .....

...and the question is closed.

[Here is a recent real-world example](https://stackoverflow.com/questions/28079837/how-do-i-echo-a-different-statement-when-different-checkboxes-are-selected-with#comment44538459_28079837) in which I could point the OP at the target dupe, suggest how their code would be adapted to the existing answer, and then close it with my dupehammer. (visible as long as no one flags & removes the referenced comment)

So to address the question asked here - _is it okay to answer?_ No. There are alternatives. Other less experienced users will probably answer before the closure is complete unless you have a dupehammer, but experienced users who know the landscape and keep a mental catalog of existing answers can navigate this scenario without scaring off new users.