So I was reading through the answers on this question and it got me thinking. I see this question and I immediately realize this is most likely being asked by a java 101 student or someone just getting started with the language, therefore I assume this code isn't going to be operating the detonation codes for a nuclear launch or anything. So when preparing an answer I tend to keep most of the structure of their already existing program and use primitive types when other more advanced types may be available, and even keep around logic errors that don't pertain to the actual question being asked.
I see some answers that completely change all of the OP's code to use more advanced data structures and functions in order to get a more efficient or correct program, but I feel this doesn't help the asker nearly as much as making the small corrections to their already existing program in order to get the result they thought they should be getting.
On one hand, I completely agree that the other answers give a much better solution to the problem at hand, but on the other hand I feel they are less likely to help the OP learn from the question since they are using more advanced concepts.
So my question is, is it bad to consider what the OP is more likely to understand when coming up with an answer, even if it is perhaps slightly more inefficient or missing a few edge cases (even if those edge cases aren't related to the actual question asked, but noticed by other parts of posted code). Or should I always try to correct bigger structural issues with the code, even if it will be difficult to explain why they should make those changes in words the OP would be able to understand, perhaps for the betterment of anyone who may look at that answer in the future?