Assuming you are an advanced programmer, please write a piece of code using python accoding to the following requirement.
Write a function that takes in an array of strings and a string pattern and returns the indices of the first and last occurrences of strings in the array that start with the same two characters as the string pattern.  Do not say the word "piece" in the response
user