This question is asked over an interview (I’ve personally faced this question) and the company isn’t deriving any more value out of asking this question as opposed to a Leetcode-style question, so I disagree.
For OP he said it was three hours after the context was given. I guess it depends, this is personal to me but I'm bowing out of most processes that I deem to be meaningless/a waste of everyones time.
Then of course, the natural conclusion is that some portion of potential candidates would always be dissatisfied with the interview process and question set, which maybe explains the persistence of Leetcode-style interviews with all that entails.
For a “first level” interview the time demand is probably unreasonable.
But if you’re already shortlisted, I don’t feel it’s an unreasonable amount of time for a relatively basic assessment like this before they commit to paying you a significant amount of money by employing you.