You actually started first but someone else does it first. do you still launch as competition or quit give up and go back in the closet ?
In general, If your idea is really taken, then you must accept the truth of this loss and deal with it. As well, You should not stand on this opportunity that you have not exploited. And from my opinion the best solution for this problem is progress, that means you must forget the past and learn from this experience and start again in the search for new ideas. and it is certain that these thoughts will be better than the last.
Furthermore, the most important thing is to achieve these ideas in fact, also exploitation of opportunities is very essential to realizate your goals.