Wasted Effort or Brilliant Outcome?

So you spend 4 days working on something, only to discover a solution that obviates everything you did and solves it in 1/5 the effort. Do you feel great about coming up with a simpler, better, faster solution, or do you feel like an idiot for wasting 4 days?