The LOCATE_PATTERN subroutine returns the position of the first occurrence of a substring in a target string (using 0-based indexing).
For example:
LOCATE_PATTERN("AGCTTAG", "CTT") would return 2LOCATE_PATTERN("AGCTTAG", "AG") would return 0targetMotif and sequence 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 targetMotif in the variable sequence and store this position in the variable position.
You must use the LOCATE_PATTERN subroutine in your answer.
Figure 1
sequence ← "AGCTTAG"
species ← "S. cerevisiae"
OUTPUT "Enter a sequence motif to search for:"
targetMotif ← USERINPUT
position ←