I answered a question that was later put on hold due to asking for a recommendation, but despite being the only answer currently there, and (in my opinion) being a suitable answer to the question being asked, it was never accepted.
I admit I used an answer provided by someone else in a different question. I linked to their answer, and told them I used it by commenting on their answer and providing a link to my question.
I did change their code a little bit to make it runnable without anything extra other than import statements. I also switched the text printed to what the question-asker used in their code example.
Is it all right for me to ask them to accept my answer if they found it useful?