The LOCATE_CHAR subroutine returns the position of the first occurrence of a character in a string (using 0-based indexing).
For example:
LOCATE_CHAR("Minecraft", "i") would return 1LOCATE_CHAR("Minecraft", "c") would return 4searchKey and game are variables used in the algorithm in Figure 1.
Complete the pseudo-code statement to find the position of the first occurrence of the contents of the variable searchKey in the variable game and store this position in the variable index.
You must use the LOCATE_CHAR subroutine in your answer.
Figure 1
game ← "Minecraft"
genre ← "Sandbox"
OUTPUT "Enter a character to search for:"
searchKey ← USERINPUT
index ←