This function returns an array in which you want to start the array element position and how many array elements you need from the start…