Skip to main content
2 of 2
added 319 characters in body
Sanchises
  • 9.5k
  • 1
  • 37
  • 63

MATL, 6 bytes

QJi-h)

Try it online!

Input is given as 1) number of elements to trim from the start; 2) number of elements to trim from the end; 3) array. Explanation

Q   % Implicit input (1). Increment by 1, since MATL indexing is 1-based.
Ji- % Complex 1i minus real input (2). In MATL, the end of the array is given by `1i`.
h   % Concatenate indices to get range-based indexing 1+(1):end-(2).
)   % Index into (implicitly taken) input array. Implicit display.
Sanchises
  • 9.5k
  • 1
  • 37
  • 63