Enter array of nums: Check if 1 appears in first or last position
Check if 1 appears in first or last position of a given array of integers. The array length must be greater or equal to 1.