Yeah, I'm definitely more the type who instead of being elated, gets pissed off to no end that he wasted like 10 hours on a 2 minute solution.
Thankfully I've learned to not do that to myself anymore. When I get stuck, I simply stop what I'm doing, and wait for the next day. For me at least, when I'm stuck, there's absolutely no point whatsoever in trying to figure out the problem then & there, because it'll never happen. You're already frustrated, and have your head into the code too much so see clearly, so there's no point in trying anymore.
After a 12 hour break and some rest though, voilia, it's usually a 5 minute solution that I can see right away after coming back to the code with a clear mind.