Just because you wrote code fast and launched fast doesn't mean someone else did. It could be they took their sweet time and had actually started first, but you beat them to market.
It IS possible for 2 people to envision the same concept in the same way. It's actually quite likely, given how imagination works.
Having said that, I also don't think there's anything wrong with seeing something and thinking you can do it slightly better. That's the nature of capitalism.