This is not how CP usually works. Most important goal here is to learn and help learning.
You are supposed to try it on your own, and come here when you got stuck with something, with a concrete question about your code, design, etc.
Please have a look to
What have you tried?[
^] to see a good explanation about what I mean.
Don't forget people here don't get payed. And besides, if we give you a ready-to-go solution, it is not going to help you because you are not going to learn anything from it.
EDIT (after comment of the algorithm):
I would say there are several points that could be important to choose the best solution. Example: the possible (max) lenght of the input string.
Considering the example you have given, I think it can be done easier.
- Take the array with the list of all reserved words in c#
- Iteration to go through the array, using
IndexOf
(
link_1[
^],
link_2[
^]) to check if the current reserved word is in the string.
If found: move to that index, counter++ and execute IndexOf again
If not: check next word
In other words, with an iteration within the other iteration it could be enough
I hope you understand what I mean