Read carefully the text before the instructions:
This loop will make sure each character of your name gets pushed to the final array.
The if statement says: "If we find the first letter of the name, start the second for
This loop says: "I'm going to add characters to the array until I
hit the length of the user's name." So if your name is 11 letters long,
your loop should add 11 characters to hits if it ever sees the first letter of
myName in text.
Maybe there is no problem to add text[j]. The count of the pushed letters is more important to this task.
Your problem was that you was adding once the characters of the name, when you have 2 occurrences of your name in the text.