Sam and Frodo need to be close. If they are side by side in the array, your function should return true. If there is a name between them, return false.
middle_earth(["Frodo", "Sam", "Gandalf"]) ➞ true
middle_earth(["Frodo", "Saruman", "Sam"]) ➞ false
middle_earth(["Orc", "Sam", "Frodo", "Legolas"]) ➞ truetrue if Frodo and Sam are side by side.