I just noticed that this upvoted question and my accepted answer to it have been deleted by a diamond ♦ moderator/SO employee. It may not have been a particularly good question, but the asker described the problem, the way he was trying to solve it (recursion), and where he got stuck (establishing a base case to stop the recursion). I see questions much worse than this with the algorithm tag daily.
The only unusual thing about the question was this paragraph:
I can not mention from where I got this problem, because I was asked not to tell. If you know the answer, I can wait a month if you like, I am not in a hurry. I am just curious.
However, afaik questions on Stack Overflow should be judged by themselves, not by whether they are homework, or an online competition, or a job interview, ... See e.g. this Q&A on Meta. If that was the reason this question was closed, does that mean that this policy has changed?