[Question]
  [
Given an integer array and two numbers as input, remove a certain amount of the first and last elements, specified by the numbers. The input can be in any order you want.
You should remove the first *x* elements, where *x* is the first numerical input, and also remove the last *y* elements, where *y* is the second numerical input.
The resulting array is guaranteed to have a length of at least two.
## Examples:
```
[1 2 3 4 5 6] 2 1 -> [3 4 5]
[6 2 4 3 5 1 3] 5 0 -> [1 3]
[1 2] 0 0 -> [1 2]
```
  
[Answer]
# Haskell, ~~55~~ ~~39~~ ~~33~~ 29 bytes
*Saved 16 bytes thanks to Laikoni*
*Saved 6 more bytes thanks to Laikoni*
*Saved 4 more bytes thanks to Laikoni*
Am sure this could be improved, but as a beginner, gave it my best shot.
```
r=(reverse.).drop
a#b=r b.r a
```
## Usage
```
(5#0) [6,5,4,3,2,1,3]
```
[Try it online!](https://tio.run/##VcxBCoMwFATQvaeYRRcRvsFE4y4nCVkIRiq1Kl/p9dMYEdpZzcBjnv3@CvMcI1vB4RN4D7KUA69bMVohuZQibY7vflpgMawFNp6WAw@MUNBwijQ11JKhzgOoKrg8/a@sYeC6JNtkDSlqfJZn@Xd1fjyf7lxO@/gF)
[Answer]
# Mathematica, 17 bytes
```
#[[#2+1;;-#3-1]]&
```
**input**
> 
> [{1, 2, 3, 4, 5, 6}, 2, 1]
> 
> 
> 
[Answer]
# Octave, 20 bytes
```
@(a,x,y)a(x+1:end-y)
```
[Try it online!](https://tio.run/##y08uSSxL/f/fQSNRp0KnUjNRo0Lb0Co1L0W3UvN/Yl6xRrSZgpGCiYKxgqmCoYJxrI6pjoHmfwA "Octave ‚Äì Try It Online")
[Answer]
# [Python](https://docs.python.org/3/), ~~28~~ 26 bytes
*-2 bytes thanks to @Rod*
```
lambda a,n,m:a[n:len(a)-m]
```
[Try it online!](https://tio.run/##HY3BDoMgEETv/Yo5Ls020WI9kPRLkANNJTWR1SiXfj0Ce5qXN5Pd/@m3ic7hPeXVx8/Xw7NwNN6KWWchrx7R5bAdSPOZsAgs2Z7xZGjGwHgxRte4VwyyY8tD08WVqnYtdU3XaeGusjM3lNuPRRIFutcPSuUL "Python 3 ‚Äì Try It Online")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 55 54 bytes
```
using System.Linq;(a,x,y)=>a.Skip(x).Take(a.Count-x-y)
```
[Try it online!](https://tio.run/##vVBNSwMxEL33Vww9JZANra29tN1LUVEUhAqeY5yW0GyiSbbuUva3x2xYFHoQT32HYZhM3sdIX0jrMNZemT1sWx@w4o/KfC5HI0iQWngPz87unajy5JRrDx9EUBKOVr3Dk1CG0J@n36UeA@1tbeRq6DdWa5RBWeP5HRp0SiZZH1bKhJJBqkP5Y//@xtQVOvGmMX8rYQfrUSSCNayl61Lw7UF9kIbyF3FAIhJJbULRFC2NQ7wzh5tEbzXyV6cCpisg8cGlw/AHm@KN2ZjBjhj8gv@kgBNMGVwxmDGYM7hmsIAuD6aU0uUl9BdZbp4tJP1kZ9ZbSO3kUhb6E/Sak3PNLnddjMUxFl5/Aw "C# (.NET Core) ‚Äì Try It Online")
Uses a `List<int>` as input.
* 1 byte saved thanks to TheLethalCoder!
[Answer]
# [Neim](https://github.com/okx-code/Neim), 3 bytes
```
ùïò‚ÇÉùïô
```
[Try it here](http://178.62.56.56:80/neim?code=%F0%9D%95%98%E2%82%83%F0%9D%95%99&input=2%0A%5B1%202%203%204%205%206%5D%0A1)
Thanks to Okx for [encouraging me](https://chat.stackexchange.com/transcript/message/38375386#38375386) to do this...:)
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 32 bytes
```
(l,i,j)->l.subList(i,l.size()-j)
```
[Try it online!](https://tio.run/##jY/BasMwDIbveQodbVBM0za9tCvsUhhspx7HDm7qBHtOYmynkI08e6Y0YWy3GoylX/r0y0beZNo61Zjr56hr1/oIhjTRRW3Fqw5xnyxyiDLq4k/12XvZByHD3Oa6i6V6YWUI8CZ1850A6CYqX8pCwQmmHGBqPryQXCl/BOmc7dl/zeKEgZ4fw/fEDXQXg2WPW6uvUJMNO0evm@r9A6SvAl9sTlDC08gsajQ8PVoRustkwzRSrL8U46nhI9zP/o6c@xBVLdouCkcTo21YKeYF5z@yDNe4wS3muOMIa4SM80fZHbFbonPMcEN0jrB6nCZnYla/zJAM4w8 "Java (OpenJDK 8) ‚Äì Try It Online")
If we really restrict to arrays, then it's 53 bytes:
```
(a,i,j)->java.util.Arrays.copyOfRange(a,i,a.length-j)
```
[Try it online!](https://tio.run/##pc9Pa8MgFADwez7FO0Z4kaZtegkb7NJbKazHsYNLTaozKmo6Qslnz8wfGOxaQZ4@nr/3lOzOMmO5ltfvUbTWuAAy5mgXhKJvzrHel4ntvpSooFLMezgxoR8JgNCBu5pVHI4w3efMxycwa1WfrmeckiCWIEkZ64a4V9AHFmK4G3GFNrLpJTihm@mhazxZ2SPU8DKmDAVKkr3@H49Wxvbn@p3phs9FjCqum3DLJBlhXuXsXHofeEtNF6iNbYLS6SoEszROa7pMr/nP8ptHjlvc4R4LPAwIW4ScEPKEd4jePooF5riLYoGweU6ME0Zn8@cMyTD@Ag "Java (OpenJDK 8) ‚Äì Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 21 bytes
19 bytes of code + `-ap` flags.
```
$_="@F[<>..$#F-<>]"
```
[Try it online!](https://tio.run/##DYoxCoAwEAT7e8V6SZuQqJdGDVb5hIpY2IkE/w/xmh1m2Hp/jzTTVSVcvZo9F17LNmfvrSluzge3CfaEX8D7yy2ix4ARgkQ9RUrqoxZBxEBCgfShG34 "Perl 5 ‚Äì Try It Online")
Uses `-a` to autosplit the input inside `@F`, then only keep a slice of it according to the other inputs: from index `<>` (second input) to index `$#F-<>` (size of the array minus third input). And `$_` is implicitly printed thanks to `-p` flag.
[Answer]
## JavaScript (ES6), 27 bytes
```
(a,n,m)=>a.slice(n,-m||1/m)
```
A negative second parameter to `slice` stops slicing `m` from the end, however when `m` is zero we have to pass a placeholder (`Infinity` here, although `(a,n,m,o)=>a.slice(n,-m||o)` also works).
[Answer]
## Rust, 29 bytes
```
|n,i,j|&n[i..<[_]>::len(n)-j]
```
Call it as follows:
```
let a = &[1, 2, 3, 4, 5, 6];
let f = |n,i,j|&n[i..<[_]>::len(n)-j];
f(a, 2, 1)
```
I had a lot of fun fighting with the borrow checker figuring out what the shortest approach was in order to have it infer the lifetime of a returned slice. Its behavior around closures is somewhat erratic, as it will infer the lifetimes, but only if you do not actually declare the parameter as a reference type. Unfortunately this conflicts with being required to define the argument type in the signature as the n.len method call needs to know the type it's operating on.
Other approaches I tried working around this issue:
```
fn f<T>(n:&[T],i:usize,j:usize)->&[T]{&n[i..n.len()-j]}     // full function, elided lifetimes
let f:for<'a>fn(&'a[_],_,_)->&'a[_]=|n,i,j|&n[i..n.len()-j] // type annotation only for lifetimes. Currently in beta.
|n:&[_],i,j|n[i..n.len()-j].to_vec()                        // returns an owned value
|n,i,j|&(n as&[_])[i..(n as&[_]).len()-j]                   // casts to determine the type
|n,i,j|&(n:&[_])[i..n.len()-j]                              // type ascription (unstable feature)
|n,i,j|{let b:&[_]=n;&b[i..b.len()-j]}                      // re-assignment to declare the type
```
[Answer]
# TIS-100, ~~413~~ 405 Bytes
472 cycles, 5 nodes, 35 lines of code
```
m4,6
@0
MOV 0 ANY
S:MOV UP ACC
JEZ A
MOV ACC ANY
JMP S
A:MOV RIGHT ACC
L:JEZ B
MOV DOWN NIL
SUB 1
JMP L
B:MOV 0 RIGHT
MOV RIGHT NIL
@1
MOV RIGHT LEFT
MOV LEFT DOWN
MOV RIGHT DOWN
MOV DOWN LEFT
@2
MOV UP ACC
MOV UP LEFT
MOV ACC LEFT
@4
MOV 0 RIGHT
MOV UP NIL
S:MOV LEFT ACC
JEZ A
MOV ACC RIGHT
JMP S
A:MOV UP ACC
L:JEZ B
MOV RIGHT NIL
SUB 1
JMP L
B:MOV 0 UP
K:MOV RIGHT ACC
MOV ACC DOWN
JNZ K
@7
MOV UP ANY
```
The m4,6 at the top is not part of the code, but signals the placement of the memory modules.
[![enter image description here](https://i.stack.imgur.com/ZTSGJ.jpg)](https://i.stack.imgur.com/ZTSGJ.jpg)
Play this level yourself by pasting this into the game:
```
function get_name()
    return "ARRAY TRIMMER"
end
function get_description()
    return { "RECIEVE AN ARRAY FROM IN.A", "RECIEVE TWO VALUES A THEN B FROM IN.T", "REMOVE THE FIRST A TERMS AND LAST B TERMS FROM IN.A", "ARRAYS ARE 0 TERMINATED" }
end
function get_streams()
    input = {}
    trim = {}
    output = {}
  arrayLengths = {}
    a = math.random(1,5) - 3
    b = math.random(1,7) - 4
    arrayLengths[1] = 9+a
    arrayLengths[2] = 9+b
    arrayLengths[3] = 8-a
    arrayLengths[4] = 9-b
    s = 0
    trimIndex = 1
  for i = 1,4 do
      for k = 1,arrayLengths[i] do
          x = math.random(1,999)
      input[k+s] = x
            output[k+s] = x
        end
        input[s + arrayLengths[i] + 1]= 0
        output[s + arrayLengths[i] + 1]= 0
        a = math.random(0,3)
        b = math.random(0,arrayLengths[i]-a)
        trim[trimIndex] = a
        trim[trimIndex+1] = b
        trimIndex = trimIndex + 2
    s = s + arrayLengths[i] + 1
    end
    s = 1
    trimIndex = 1
    for i = 1,4 do
      for i = s,s+trim[trimIndex]-1 do
          output[i]=-99
        end
        for i = s + arrayLengths[i] - trim[trimIndex+1], s + arrayLengths[i]-1 do
      output[i]=-99
        end
  trimIndex = trimIndex +2
  s = s + arrayLengths[i] + 1
    end
    trimmedOut = {}
    for i = 1,39 do
            if(output[i] ~= -99) then
                    table.insert(trimmedOut, output[i])
            end
    end
    return {
        { STREAM_INPUT, "IN.A", 0, input },
        { STREAM_INPUT, "IN.T", 2, trim },
        { STREAM_OUTPUT, "OUT.A", 1, trimmedOut },
    }
end
function get_layout()
    return {
        TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,
        TILE_MEMORY,    TILE_COMPUTE,    TILE_MEMORY,   TILE_COMPUTE,
        TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,
    }
end
```
So I suppose this also counts as a lua answer...
[Answer]
# [MATL](https://github.com/lmendo/MATL), 6 bytes
```
QJi-h)
```
[Try it online!](https://tio.run/##y00syfn/P9ArUzdD8/9/Qy4jrmhDBSMFYwUzBQsFSwXjWAA "MATL ‚Äì 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.
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 3 bytes
```
‚Üì‚Üì_
```
[Try it online!](https://tio.run/##yygtzv7//1HbZCCK////v@H/aEMdIx1jHRMdUx2z2P9GAA "Husk ‚Äì Try It Online")
### Explanation
```
                                               |  1 [1,2,3,4,5,6] 2
  _  -- negate y                               | -1 [1,2,3,4,5,6] 2
 ‚Üì   -- drop y from end (negative argument)    |  [1,2,3,4,5] 2
‚Üì    -- drop x from beginning                  |  [3,4,5]
```
[Answer]
# C#, 62 bytes
```
using System.Linq;(l,x,y)=>l.Where((n,i)=>i>=x&i<=l.Count-y-1)
```
Takes a `List<int>` as input and returns an `IEnumerable<int>`.
---
This also works for 64 bytes:
```
using System.Linq;(l,x,y)=>l.Skip(x).Reverse().Skip(y).Reverse()
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 10 bytes
```
tniQwi-&:)
```
[Try it online!](https://tio.run/##y00syfn/vyQvM7A8U1fNSvP//2hDBSMFYwUTBVMFs1guIy5DAA "MATL ‚Äì Try It Online")
## Explanation:
It's a bit long for just 11 bytes, but I'm writing it out in detail, to learn it myself too.
```
---- Input ----
[1 2 3 4 5 6]
2
1
----- Code ----
           % Implicit first input
t          % Duplicate input.
           % Stack: [1 2 3 4 5 6], [1 2 3 4 5 6]
 n         % Number of elements
           % Stack: [1 2 3 4 5 6], 6
  i        % Second input
           % Stack: [1 2 3 4 5 6], 6, 2
   Q       % Increment: [1 2 3 4 5 6], 6, 3
    w      % Swap last two elements
           % Stack: [1 2 3 4 5 6], 3, 6
     i     % Third input
           % Stack: [1 2 3 4 5 6], 3, 6, 1
      -    % Subtract
           % Stack: [1 2 3 4 5 6], 3, 5
       &:  % Range with two input arguments, [3 4 5]
           % Stack: [1 2 3 4 5 6], [3 4 5]
         ) % Use as index
           % Stack: [3 4 5]
           % Implicit display
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
·πñ¬°·∏ä‚Å¥¬°
```
[Try it online!](https://tio.run/##AS0A0v9qZWxsef//4bmWwqHhuIrigbTCof///1sxLCAyLCAzLCA0LCA1LCA2Xf8y/zE "Jelly ‚Äì Try It Online")
[Answer]
# Dyalog APL, 16 bytes
```
{(‚çµ‚Üì‚ç®‚äÉ‚ç∫)‚Üì‚ç®-‚ç∫[2]}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v8/7VHbhGqNR71bH7VNftS74lFX86PeXZoQji6QGW0UW/v/v5GCoUIaEBspGCuYKJgqmHGZKhgARcyAIiZAMVOgnDGXAVgMqAoA)
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), ~~8~~ 7 bytes
```
‚åΩ‚éï‚Üì‚åΩ‚éï‚Üì‚éï
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qKMdSPTsfdQ39VHbZASjbypI6n86l6GCkYKxgomCqYIZlxGXIVc6lxlQxAQoZqpgqGDMZcplwAVWBaQNAA "APL (Dyalog Unicode) ‚Äì Try It Online")
This takes the array as the first input, followed by the two numbers separately.
### Explanation
```
‚éï            from the input array
‚éï‚Üì           drop the first input elements
‚åΩ            reverse the array
‚éï‚Üì           drop first input elements
‚åΩ            reverse again to go back to the original array
```
[Answer]
# PHP>=7.1, 59 bytes
```
<?[$a,$b,$e]=$_GET;print_r(array_slice($a,$b,$e?-$e:NULL));
```
[PHP Sandbox Online](http://sandbox.onlinephpfunctions.com/code/aea18f7a87853a03a8772dd5b7dfaf37540ecd92)
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), 60 bytes
```
(()()){({}<{({}<{}>[()])}{}([]){{}({}<>)<>([])}{}<>>[()])}{}
```
[Try it online!](https://tio.run/##SypKzMzTTctJzP7/X0NDU0NTs1qjutYGQtTaRWtoxmrWVtdqRMdqVgMpoKidpo0diFsLYsMV/P9vzMVlyGXEZcxlwmXKxWUAAA "Brain-Flak ‚Äì Try It Online")
Input is in this format:
```
x
a
r
r
a
y
y
```
Where `x` is the number to take from the front, `y` is the number to take from the back, and the array is just however many numbers you want, separated by newlines. Here are my first two (longer) attempts:
```
({}<>)<>{({}<{}>[()])}([])<>({}<><{{}({}<>)<>([])}{}><>){({}<{}>[()])}{}([]){{}({}<>)<>([])}<>{}
{({}<{}>[()])}{}([]){{}({}<>)<>([])}{}<>{({}<{}>[()])}{}([]){{}({}<>)<>([])}<>
```
And here is an explanation:
```
#Two times:
(()()){({}<
    #Remove *n* numbers from the top of the stack
    {({}<{}>[()])}{}
    #Reverse the whole stack
    ([]){{}({}<>)<>([])}{}<>
>)[()]}{}
```
[Answer]
# [R](https://www.r-project.org/), ~~32~~ ~~31~~ 30 bytes
*-1 byte thanks to Rift*
*-1 byte thanks to Jarko Dubbeldam*
```
pryr::f(n[(1+l):(sum(n|1)-r)])
```
Evaluates to an anonymous function:
```
function (l, n, r) 
    n[(1 + l):(sum(n|1) - r)]
```
`1+l` is necessary since R has 1-based indexing. `sum(n|1)` is equivalent to `length(n)` but it's a byte shorter.
[Try it online!](https://tio.run/##K/qfZvs/rTQvuSQzP08jRydPp0gzL1rDUDtH00qjuDRXI6/GUFO3SDP2f5qGkY6hlZmOoSZXmoYBkGmkY6D5HwA "R ‚Äì Try It Online")
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 5 bytes
```
(‚åΩ‚Üì)/
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v8/7VHbBI1HPXsftU3W1Od61DcVyE8DUtiZ//8bKhgpaIAIYwUTBVMFM00uAyClYQYUMQGKmSoYKhiDxAzAqjQB "APL (Dyalog Classic) ‚Äì Try It Online")
---
Input format is `y x A`
**Explanation**
`/` is Reduce, which inserts the function to the left between each pair of elements of the argument
`(‚åΩ‚Üì)` is a function train equivalent to `{‚åΩ‚ç∫‚Üì‚çµ}`, which removes the first `‚ç∫` elements of the array `‚çµ` and then reverses the array. (`‚ç∫` is the left argument and `‚çµ` is the right argument)
Thus, `(‚åΩ‚Üì)/y x A` is equivalent to `‚åΩy‚Üì‚åΩx‚ÜìA`, which is what is needed.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 17 bytes
```
->a,b,c{a[b..~c]}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y5RJ0knuToxOklPry45tvZ/gUJadLShjpGOsY6JjqmOWSyQaRjLBRY2A7JNgBKmOoY6xrFAyiD2PwA "Ruby ‚Äì Try It Online")
[Answer]
# C++, ~~50~~ ~~48~~ 46 bytes
```
#define f(a,x,y)decltype(a)(&a[x],&*a.end()-y)
```
[Try it online!](https://tio.run/##RY7LCoMwEEX3@YpBQZIyFmofCw3@SOkiJLEENBGNRRG/PbUptAcuDPcMw8i@z59ShpAq3RiroaECZ1yY0rL1S6@pYDQT9/mB2UEctVWU5QsLqbGynZQGbtzoBy26mvy7l5beDTUx1kMnjKWMrAR2Rq/K8mv5LmsQ6wkLPOMFr3jbKhK3GjdQEJN3YMr4UIEFY1F9@A3xmnSTB87B7EkgqcgW3g "C++ (gcc) ‚Äì Try It Online")
[Answer]
# C++, ~~96~~ 95 bytes
*Thanks to @Tas for saving a byte!*
```
#import<list>
int f(std::list<int>&l,int x,int y){for(l.resize(l.size()-y);x--;)l.pop_front();}
```
[Try it online!](https://tio.run/##VY3dCsMgDIWv51OEDoaCLXR/F9XtVUaxdgi2imawrfTZO2uvlouT5MvhRHlfPpValr0ZvAsorYl4J2ZE6GnErmlWINN@P1i@4nfWD5t6F6itgo7mq9OQGys/TLzLUjBbeecffXAjUibmlD8q@@o0SOMiBt0O25ehNSNlZCKQ6v8hoI4IN5hqDkcOJw5nDhcO11lkd09XQ77VbEMbdwHomm2gyRmM7HKyci8EKRNPUkAhyLz8AA)
# C++ (MinGW), 91 bytes
```
#import<list>
f(std::list<int>&l,int x,int y){for(l.resize(l.size()-y);x--;)l.pop_front();}
```
[Answer]
# [Kotlin](https://kotlinlang.org), 30 bytes
```
{a,s,e->a.drop(s).dropLast(e)}
```
[Try it online!](https://tio.run/##dY1NCsIwEIX3nmKWGZhKa2sXpQZcCgUXniBgU4IxLUkUpPTsMY3gSmfx5u99M7fRa2WCfBi4C2WYsINr4GiteLUXb5UZOMK8gRhPoUE2wDrlfHsynhNETYKQcfjO4QBhFuSoz7jYXu04MYcpd8J51uMS1ntTvO61YZLpSJ4lKwh2BCVBRbAnqDH1BeLmp71O6yoR0R7pElOV/yPWB9GSfyxLeAM "Kotlin ‚Äì Try It Online")
Takes `List<Int>` as input and drops from begin and then from end.
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 10 bytes
```
{(-z)_y_x}
```
[Try it online!](https://tio.run/##y9bNz/7/v1pDt0ozvjK@ojbaUMFIwVjBRMFUwczayNow9v9/AA "K (oK) ‚Äì Try It Online")
Port of my q/kdb+ answer...
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~11~~ 10 bytes
```
kb‚ÇçB&t;Bk‚Çç
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/PzvpUVOvk1qJtVM2kPH/f7SRjkK0kaGOgpExEJsCsTkQW@ooGBvG6igYxv6PAgA "Brachylog ‚Äì Try It Online")
Takes input as [x, A, y] where A is the array to trim. 
*(-1 byte thanks to @Fatalize.)*
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 6 bytes
```
oW UsV
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=b1cgVXNW&input=WzEgMiAzIDQgNSA2XQoyCjEKLVE)
```
sVWnUl
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=c1ZXblXK&input=WzYgMiA0IDMgNSAxIDNdCjUKMAotUQ)
```
oW UsV     :Implicit input of array U and integers V=x & W=y
oW         :Remove the last W elements of U, mutating the original
   UsV     :Slice U from 0-based index V
```
```
sVWnU√ä     :Implicit input of array U and integers V=x & W=y
sV         :Slice U from 0-based index V to index
  Wn       :  Subtract W from
    U√ä     :  Length of U
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
F¬¶}sF¬®
```
[Try it online!](https://tio.run/##MzBNTDJM/f/f7dCy2mK3Qyv@/zfiijbUMdIx1jHRMY3lMgQA "05AB1E ‚Äì Try It Online")
```
F }    # For 0 .. number of elements to remove from front
 ¬¶     #   Remove the first element
   s   # Get the next input
    F  # For 0 .. number of elements to remove from back
     ¬® #   Remove the last element
```
]