In under 45 minutes? Are you really concerned with their ability to even naively solve an algorithmic problem in that time frame? I would think not. No, this is not only flawed, but it's so deeply flawed (and easily exploitable), that you're not even interviewing for skill set anymore, simply either 1) someone's luck for having been exposed to the problem before or 2) their ability to remember things they don't use day to day.
Congratulations, you're hiring lucky people or idiot savants.