What you really need to ask yourself is "Will other people likely stumble upon this issue in their code and find my question helpful?" If the answer is yes, then there's no need to delete your question.
Instead, you should post what you did as an answer. You may not be able to explain why this solution worked, but you can at least verify that it did. I suggest you refrain from saying as much in your answer, however, though you could ask for an explanation if anyone has one in the comments, I would think. Keep it to the facts. As a very basic example:
I found the fix to my issue was X:
code example showing the fix
It's a rather small answer, but it can still help others who encounter the same issue down the line. Be sure to explain what "X" was in words, rather than just dumping code and saying "Well, this worked" in your answer. While that would be an answer to the question, it'll be a more helpful answer if you explain to the best of your abilities what you changed, even if you can't explain why.
In the future, someone who does understand why the code worked one way but not the other may either comment on your answer to explain it to you (and therefore allow you to update your answer with the explanation) or write their own answer with an explanation of why this worked. If this happens, you can then decide to accept their answer, whether you had previously accepted your own or not.
Keep in mind that questions and answers on the site aren't just for the person asking- We're trying to build a high-quality repository of questions and answers to programming questions, so that other visitors in the future can find their answers without the need to create an account and ask questions. Deleting good content prevents this, so when given the choice, at the very least giving your found solution to your own question is more useful in the long run.