[Question]
  [
### Introduction
Let's observe the following string:
```
ABCDEFGHIJKLMNOP
```
If we swap the **ends of the string**, which are these:
```
ABCDEFGHIJKLMNOP
^^            ^^
```
We get the following result:
```
BACDEFGHIJKLMNPO
```
After that, we delete the ends of the string, which in this case are `B` and `O`. The result is:
```
ACDEFGHIJKLMNP
```
If we repeat the process, we get the following list:
```
N     Result
2     ADEFGHIJKLMP
3     AEFGHIJKLP
4     AFGHIJKP
5     AGHIJP
6     AHIP
7     AP
```
You can see that for **N = 5**, the result is `AGHIJP`. At **N = 7**, the length of the string is smaller than **3**, so N > 7 is considered *invalid* in this case.
### The Task
Given a string **S** with *at least* length 4 and the number of repetitions **N** > 0, output the final result. You can assume that N is always *valid*.
### Test cases
```
Input                               >  Output
N = 3, S = ABCDEFGHIJKLMNOP         >  AEFGHIJKLP
N = 1, S = Hello                    >  Hlo
N = 2, S = 123321                   >  11
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the submission with the least amount of bytes wins! For the simplicity, you can assume that the string will only contain **alphanumeric** characters.
  
[Answer]
# [Retina](https://github.com/mbuettner/retina), ~~44~~ 20 bytes
[Crossed out 44 is still regular 44 :(](https://codegolf.stackexchange.com/questions/62732/implement-a-truth-machine/63380#63380)
```
+`'(\w).(.*).\B
$1$2
```
Assumes input in following format (in unary - counting character: `'`):  
`{number of repeats}{string}`  
For example: `'''''''ABCDEFGHIJKLMNOP`  
There is no space between number of repeats and the string.
Thanks [@MartinBüttner](https://codegolf.stackexchange.com/users/8478/martin-b%C3%BCttner) for shaving off 24 bytes!
[Try it online!](http://retina.tryitonline.net/#code=K2AnKFx3KS4oLiopLlxCCiQxJDI&input=JycnJycnJ0FCQ0RFRkdISUpLTE1OT1A)
[Answer]
## Python 2, 31 bytes
```
lambda s,n:s[0]+s[n+1:~n]+s[-1]
```
I think this works?
[Answer]
## [Labyrinth](https://github.com/mbuettner/labyrinth), 40 bytes
```
<
,,}:?
.
;("   {(={}{".
,",;=};} }) "{@
```
Input is `N` followed by the string, separated by any non-numeric character.
[Try it online!](http://labyrinth.tryitonline.net/#code=PAosLH06PwouCjsoIiAgIHsoPXt9eyIuCiwiLDs9fTt9IH0pICJ7QA&input=NSBBQkNERUZHSElKS0xNTk9Q)
This was written in collaboration with Sp3000 (which means I couldn't be bothered to figure out an algorithm, so he started working on it, came up with 118 byte solution but couldn't be bothered golfing it, so I did the golfing... yay for teamwork).
### Explanation
Sp's usual primer (as usual slightly modified):
* Labyrinth is a stack-based 2D language with two stacks, main and auxiliary. Pretty much everything happens on the main stack, but you can shift values over to the other one, e.g. to reverse them or save them for later.
* The stacks are bottomless and filled with zeroes, so popping from an empty stack is not an error.
* Execution starts from the first valid character (here the top left). At each junction, where there are two or more possible paths for the instruction pointer (IP) to take, the top of the stack is checked to determine where to go next. Negative is turn left, zero is go forward and positive is turn right. While this was *meant* to make the code look like winding, twisty passages, there's nothing stopping you from making "rooms" where these conditions are checked in every cell. Those can yield quite unpredictable behaviour, but are great for golfing.
* The source code (and therefore the layout of the labyrinth) can be modified at runtime using `<>^v` which cyclically shifts a row or column or the grid.
* `"` are no-ops.
Here we go.
The code starts on the `<`, which is a golfing trick I've used a few times when starting with a long piece of linear code. It shifts the first row cyclically to the left, *with the IP on it*, so the source then looks like this:
```
              <
,,}:?
.
;("   {(={}{".
,",;=};} }) "{@
```
But now the IP can't move anywhere, so it executes the `<` again. This continues until we reach this state:
```
    <
,,}:?
.
;("   {(={}{".
,",;=};} }) "{@
```
At this point, the IP can leave the cell and begin executing the second line starting from the `?`. So here's the linear code broken down:
```
?   # Read the first integer on STDIN, i.e. N.
:}  # Duplicate it and move one copy over to the auxiliary stack.
,   # Read the separator character.
,.  # Read the first character of the input string and directly print it.
```
The IP now enters this 3x2 room, which is actually two tightly-compressed (overlapping) 2x2 clockwise loops. The first loop reads and discards `N-1` characters from STDIN.
```
;   # Discard the top of the stack. On the first iteration, this is the
    # separator we've already read. On subsequent iterations this will be
    # one of the N-1 characters from the input string.
(   # Decrement N. If this hits zero, we leave the loop, otherwise we continue.
,   # Read the next character from STDIN to be discarded.
```
Now we enter the second loop which reads the remainder of the input string. We can detect EOF because `,` will return `-1` in that case, making the IP turn left.
```
,   # Read a character. Exit the loop if EOF.
(   # Decrement it.
```
That decrement isn't actually useful, but we can undo it later for free and here it allows us to overlap the two loops.
If we take the `5 ABCDEFGHIJKLMNOP` input as an example, the stack looks like this:
```
Main [ ... 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' -1  |  5 ... ] Auxiliary
```
Note that these actually correspond to the input characters `FGHIJKLMNOP` (because we decremented them), and that we don't actually want to print the first of those (we've only discarded `N-1` characters, but want to skip `N`).
Now there's a short linear bit that prepares the stack for the next loop:
```
;   # Discard the -1.
=   # Swap the tops of the stacks, i.e. N with the last character. 
    # By putting the last character on the auxiliary stack, we ensure that
    # it doesn't get discarded in the next loop.
}   # Move N over to the auxiliary stack as well.
```
The stacks now look like:
```
Main [ ... 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N'  |  5 'O' ... ] Auxiliary
```
We enter another 2x2 clockwise loop. This discards the top `N` characters from the main stack:
```
;   # Discard the top of the main stack.
{   # Pull N over from the auxiliary stack.
(   # Decrement it. It it's 0 we leave the loop.
}   # Push N back to the auxiliary stack.
```
When we exit the loop `=` swaps that `0` and the last character of the input string again. Now the stacks look like this:
```
Main [ ... 'E' 'F' 'G' 'H' 'I' 'O'  |  ... ] Auxiliary
```
We want to print the contents of the main stack (except the bottom element and all incremented by 1), *from the left*. That means we need to get it over to the auxiliary stack. That's what the next 2x2 (clockwise) loop does:
```
{   # Pull an element over from the auxiliary stack. This is necessary so we
    # have a 0 on top of the stack when entering the loop, to prevent the IP
    # from turning right immediately.
}   # Move the top of the main stack back to the auxiliary stack. If this was the
    # bottom of the stack, exit the loop.
)   # Increment the current character.
}   # Move it over to the auxiliary stack.
```
Stacks now:
```
Main [ ...  |  'F' 'G' 'H' 'I' 'J' 'P] ... ] Auxiliary
```
We move the first of those (the one we don't want to print) back to the main stack with `{`. And now we enter final 2x2 (*counterclockwise*) loop, which prints the rest:
```
{   # Pull another character over from the auxiliary stack. Exit the loop
    # if that's the zero at the bottom of the stack.
.   # Print the character.
```
Finally we terminate the program with `@`.
[Answer]
# Mathematica, 29 bytes
My first answer!
```
#~Delete~{{2},{-2}}&~Nest~##&
```
The crux of bracketless Mathematica!
Function inputs are a list (of characters, or whatever) and a number.
[Answer]
## JavaScript (ES6), 39 bytes
```
(s,n)=>s[0]+s.slice(++n,-n)+s.slice(-1)
```
Turns out I just reinvented @Sp3000's answer.
[Answer]
# Jelly, 8 bytes
```
Ḣ1¦UðḤ}¡
```
[Try it online!](http://jelly.tryitonline.net/#code=4biiMcKmVcOw4bikfcKh&input=&args=IkFCQ0RFRkdISUpLTE1OT1Ai+Nw)
### How it works
```
Ḣ1¦UðḤ}¡  Main link. Left input: S (string). Right input: N (deletions)
Ḣ         Pop the first element of S.
          This return the element and modifies S.
 1¦       Apply the result to the first index.
          This replaces the first character of the popped S with the popped char.
   U      Upend/reverse the resulting string.
    ð     Convert the preceding chain into a (dyadic) link.
     Ḥ}   Apply double to the right input.
          This yields 2N.
       ¡  Repeat the link 2N times.
```
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 8 ~~9~~ ~~12~~ ~~13~~ bytes
```
th"P[]2(
```
Inputs are: first `N` as a unary string with quotes (allowed by the challenge); second `S` as a string with quotes (quotes in strings are allowed by default); separated by a linebreak.
This works by flipping the string, removing its second element, and repeating for a total of `2*N` times.
[**Try it online!**](http://matl.tryitonline.net/#code=dGgiUFtdMig&input=JzExMScKJ0FCQ0RFRkdISUpLTE1OT1An)
```
th       % implicitly take first input (N) as a unary string. Concatenate horizontally
         % with itself: gives a string of 2*N ones
"        % for each (i.e., repeat 2*N times)
  P      %   flip string. Take S implicitly as input the first time
  []     %   empty array (used as new contents)
  2      %   2 (used as index)
  (      %   assign [] to position 2 of string; that is, remove second element
         % implicitly end for each
         % implicitly display
```
[Answer]
## [Jelly](https://github.com/DennisMitchell/jelly), 10 [bytes](https://github.com/DennisMitchell/jelly/blob/master/docs/code-page.md)
```
Ḣ;ṪjḊṖ$Ɠ¡F
```
Input [the number via STDIN, and the string via command line args](http://meta.codegolf.stackexchange.com/a/5415/21487). Thanks to @Dennis for a lot of hints/help getting this to work (Jelly still eludes me).
[Try it online!](http://jelly.tryitonline.net/#code=4biiO-G5qmrhuIrhuZYkxpPCoUY&input=Mg&args=IjEyMzMyMSI)
```
Ḣ;Ṫ               Pop first and last chars of string and concatenate
   j              Join by...
       Ɠ¡           Execute n times...
    ḊṖ$               Drop first, drop last of string ($ combines the two monadically)
         F        Flatten to filter out empty lists, since Jelly's j is weird
```
[Answer]
## Pyth, 13 bytes
```
++hz:zhQ_hQez
```
Explanation:
```
              - autoassign z = input()
              - autoassign Q = eval(input())
    :zhQ_hQ   -  z[Q+1:-(Q+1)]
++hz       ez - z[0]+^+z[-1]
```
[Try it here](http://pyth.herokuapp.com/?code=%2B%2Bhz%3AzhQ_hQez&input=Swap+delete+and+repeat%0A8&debug=0)
[Answer]
## Ruby, 29 bytes
```
->s,n{s[0]+s[n+1...~n]+s[-1]}
```
Very straightforward.
`~` trick stolen from [Sp's answer](https://codegolf.stackexchange.com/a/73583/3808), which saves a byte over `s[n+1..-2-n]`. (It works because `~n` is `-1-n` in two's-complement, and then `...` is an exclusive range.)
[Answer]
# Vitsy, ~~12~~ 9 (code) + 1 (newline for function declaration) = 10 bytes
\o/
Expects input on the stack as the string followed by the number.
```
2*\[vXvr]
2*         Multiply by 2.
  \[    ]  Do the stuff in the brackets that many times. (input num * 2)
    v      Take the top item off the stack and save it as a local variable.
     X     Remove the top item of the stack.
      v    Push the temporary variable back onto the stack.
       r   Reverse the stack.
```
Which you can call with:
```
'String' r <number> 1m Z
2*\[vXvr]
```
This is a function that leaves the resultant string on the stack. I have provided it as a program in the TryItOnline link.
[TryItOnline!](http://vitsy.tryitonline.net/#code=J0FCQ0RFRkdISUpLTE1OT1AnIHIgMyAxbSBaCjIqXFt2WHZyXQ&input=)
[Answer]
## Perl, ~~36~~ 32 + 1 = 33 bytes
```
for$i(1..<>){s;\B.(.+).(.);$1$2;}
```
Requires `-p` flag and takes input on two lines, with numbers of iterations at the end:
```
$ perl -pe'for$i(1..<>){s;\B.(.+).(.);$1$2;}' <<< $'ABCDEFGHIJKLMNOP\n4'
AFGHIJKP
```
Ungolfed?
```
for $i ( 1..<> ) {
  s;
  \B.(.+).(.);$1$2;x
}
```
[Answer]
# Python 2, ~~49~~ 48 bytes
```
g=lambda s,n:n and g(s[0]+s[2:-2]+s[-1],n-1)or s
```
[Try it here with testcases!](https://repl.it/BoVJ/1)
Simple recursive solution. Removes the second and last second element from the input string and calls itself with this and `n-1` until `n=0`.
**edit:** Feeling kinda stupid, looking at [the other python solution](https://codegolf.stackexchange.com/a/73583/49110). Guess I just like recursion too much...
[Answer]
# C, 96 bytes
```
i;main(c,v,p)char**v,*p;{i=atoi(v[2])+1;c=strlen(p=v[1]);printf("%c%.*s%s",*p,c-2*i,p+i,p+c-1);}
```
## Ungolfed
```
i; /* Param 2, the number of chars to remove */
main(c,v,p)char**v,*p;
{
    i=atoi(v[2])+1; /* convert param 2 to integer */
    c=strlen(p=v[1]); /* Length of the input */
    printf("%c%.*s%s",*p, /* Print the first char... */
        c-2*i, /* a number of characters equal to the length minus twice the input... */
        p+i, /* skip the "removed" chars... */
        p+c-1); /* Print the last character of the string */
}
```
[Answer]
## Rust, 135 bytes
Well, that's a pretty terrible length.
```
fn f(s:&str,n:usize)->String{let s=s.as_bytes();s[..1].iter().chain(&s[n+1..s.len()-n-1]).chain(s.last()).map(|d|*d as char).collect()}
```
Pretty-printed:
```
fn f(s: &str, n: usize) -> String {
    let s = s.as_bytes();
    s[..1].iter()
          .chain(&s[n+1..s.len()-n-1])
          .chain(s.last())
          .map(|d| *d as char)
          .collect()
}
```
You can get it down to **104** bytes if we allow bytestrings instead of proper strings.
```
fn f(s:&[u8],n:usize)->Vec<u8>{let mut r=vec![s[0]];r.extend(&s[n+1..s.len()-n-1]);r.extend(s.last());r}
```
Pretty-printed:
```
fn f(s: &[u8], n: usize) -> Vec<u8> {
    let mut r = vec![s[0]];
    r.extend(&s[n+1..s.len()-n-1]);
    r.extend(s.last());
    r
 }
```
Curious if anyone can do better.
[Answer]
# CJam, 12 bytes
```
q~{VW@)t(t}*
```
[Try it online!](http://cjam.tryitonline.net/#code=cX57VldAKXQodH0q&input=IkFCQ0RFRkdISUpLTE1OT1AiIDc)
### How it works
```
q~            Read and evaluate all input. This pushes S (string) and N (integer).
  {       }*  Do the following N times:
   VW           Push 0 and -1.
     @          Rotate S on top of them.
      )         Pop the last character of S.
       t        Set the item at index -1 to that character.
        (       Pop the first character of S.
         t      Set the item at index 0 to that character.
```
[Answer]
# Octave, 28 bytes
```
@(S,N)S([1,N+2:end-N-1,end])
```
Index the string, omitting `S(2:N+1)` and `S(end-N:end-1)`.
Sample run on [ideone](http://ideone.com/CcR75J).
[Answer]
# Vim, 27 bytes
```
o0lxehx <ESC>"ay0ddA@a<ESC>B"bdWx@b
```
Input is expected to be in the form `STRING N` on the first line with no other characters.
Explanation:
```
#Write a macro to do one round of the swap and delete and save to register a
o0lxehx <ESC>"ay0dd
#Append register a to N and save in register B so it will run @a N times.
A@a<ESC>B"bdWx
# Actually run the macro
@b
```
[Answer]
# mSL - 137 bytes
```
c {
%l = $len($1)
return $mid($+($mid($1,2,1),$left($1,1),$right($left($1,-2),-2),$right($1,1),$mid($1,$calc(%l -1),1)),2,$calc(%l -2))
}
```
## Explanation:
`%l = $len($1)` will get the length of the input string and saves it in variable called l
`$right(<input>,<length>)` and `$left(<input>,<length>` can be used to return the left or right most part of the original string respectably. $left always return text starting from the very left side while $right always return text starting from the right side. If the length specified is a negative number, $left and $right return the entire text minus that many characters from their respective sides.
`$mid(<string>,<start>,[length])` is used to get a substring from the middle of the string. Start is the start of the substring from the left. A negative value indicates a start from the right. In both case, an optional length can be specified. A negative length can be used to remove that many characters from the end. So I used it to retrieve the second character and the second last character by using the length of the input string.
`$calc(<input>)` is used to perform mathematical calculations
[Answer]
## Brainfuck, 130 bytes
My first PPCG entry!
Obviously not gonna win but hey.
Takes input like: 4ABCDEFGHIJKL, with the first character being N.
```
,>+++++++[<------->-]<+>>+[>,]<[<]>-<<[>>>[<+>-]>[<+>-]<<[>>+<<-]>[>]<[>+<-]<[>+<-]>>[<<+>>-]<[-]<[<]>[-]>[[<+>-]>]<<[<]<<-]>>>[.>]
```
Test it on [this](https://fatiherikli.github.io/brainfuck-visualizer/#LD4rKysrKysrWzwtLS0tLS0tPi1dCjwrPj4rWz4sXTxbPF0+LTw8Cls+Pj5bPCs+LV0+WzwrPi1dPDxbPj4rPDwtXT5bPl08Wz4rPC1dPFs+KzwtXT4+Wzw8Kz4+LV0KPFstXTxbPF0+Wy1dPltbPCs+LV0+XTw8WzxdPDwtXQo+Pj5bLj5dCgohM0FCQ0RFRkc= "this") wonderful site.
Limited to N less than or equal to 9, because two-digit numbers are a pain in the butt.
EDIT: I sucked it up and added support for two-digit numbers. Pad with a zero for single digits.
```
,>+++++++[<------->-]<+ [>++++++++++<-]>[<+>-],>+++++++[<------->-]<+ [<+>-]>+[>,]<[<]>-<<[>>>[<+>-]>[<+>-]<<[>>+<<-]>[>]<[>+<-]<[>+<-]>>[<<+>>-]<[-]<[<]>[-]>[[<+>-]>]<<[<]<<-]>>>[.>]
```
[Answer]
## As of yet untitled language (so new noncompetitive), 9 bytes
```
hD_RQ:Q|J
```
You can find the source code [here](https://github.com/muddyfish/PYKE), language is completely unstable (first test challenge for it) so don't expect it to work in the future (commit 7)
This is a stack based language with functions that add and remove objects from the stack. There are currently 2 stack manipulation commands: `D`(duplicate the top of the stack N times) and `R`(rotate the top N items on the stack)
Explanation:
```
          - autoassign Q = eval_or_not(input()) (string)
h         - imp_eval_input()+1
 D        - duplicate(^)
  _       - neg(^)
   R      - rotate(^)
    Q:    - Q[^:^]
      Q|  - Q[0], Q[-1]
        J - "".join(all)
```
[Answer]
## CJam, 14 bytes
```
l(o)\l~_W*@<>o
```
[Test it here.](http://cjam.aditsu.net/#code=l(o)%5Cl~_W*%40%3C%3Eo&input=ABCDEFGHIJKLMNOP%0A5)
### Explanation
```
l   e# Read the input string.
(o  e# Pull off the first character and print it.
)\  e# Pull off the last character and swap with the rest of the string.
l~  e# Read the second line of the input and evaluate it (N).
_   e# Duplicate.
W*  e# Multiply by -1 to get -N.
@   e# Pull up the string.
<   e# Discard the last N characters.
>   e# Discard the first N characters.
o   e# Output what's left. The last character of the input is now still on the
    e# stack and is automatically printed at the end of the program.
```
[Answer]
# Perl, 27 bytes
Include +1 for `-p`
Run as `perl -p sdr.pl`
Input given on STDIN, first line the string, second line the count
Assumes the string contains only "word" characters
`sdr.pl`:
```
eval's%\B.(.*).\B%$1%;'x<>
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `Ṫ`, 8 bytes
```
f÷?d($_^
```
[Try it online!](https://vyxal.pythonanywhere.com/#WyLhuaoiLCIiLCJmw7c/ZCgkX14iLCIiLCJcIjEyMzMyMVwiXG4yIl0=)
Explanation:
```
f         # Get the list of characters
 ÷        # and push each one to the stack.
   d      # Double
  ?       # the input
    (     # times:
     $    #   swap the top two items
      _   #   pop the stack
       ^  #   then reverse the stack.
          # Sum the whole stack and print
```
[Answer]
# [Factor](https://factorcode.org/), 47 bytes
```
[ 1 cut pick tail 1 cut* swap roll head* glue ]
```
[Try it online!](https://tio.run/##RY5LC4JAGEX3/oqLSxeBuisIeqo9LIhW0WKYPlOc1OZBhPjbJ8Ogu7vn3MXNGNe1tOdTkkZjMKVqrtBI0vrdyKLSUPQ0VHFSKElWJKByk2WCMHGc1kGfFiHc2XyxXK2jONlsd/v0cHTR/aQPNyYh6j8J4PpBGAb@F3X20k@40WgKXkKzQgzdg3qxBrIWAjmxm4e7MISrzYab00dvR/YD "Factor – Try It Online")
```
       ! 5 "ABCDEFGHIJKLMNOP"
1      ! 5 "ABCDEFGHIJKLMNOP" 1
cut    ! 5 "A" "BCDEFGHIJKLMNOP"
pick   ! 5 "A" "BCDEFGHIJKLMNOP" 5
tail   ! 5 "A" "GHIJKLMNOP"
1      ! 5 "A" "GHIJKLMNOP" 1
cut*   ! 5 "A" "GHIJKLMNO" "P"
swap   ! 5 "A" "P" "GHIJKLMNO"
roll   ! "A" "P" "GHIJKLMNO" 5
head*  ! "A" "P" "GHIJ"
glue   ! "AGHIJP"
```
[Answer]
# PHP, 60 bytes
This solution iteratively sets characters from the input string to an empty string by index. I'm manipulating the input string directly to prevent a long `return`.
```
function(&$w,$i){for(;$i;)$w[$i--]=$w[strlen($w)-$i-2]="";};
```
Basically in memory `$w` looks like this when done:
```
Addr 0 1 2 3 4
     H   l   o
     ^   ^   ^
>Result: Hlo
```
Run like this:
```
php -r '$f = function(&$w,$i){for(;$i;)$w[$i--]=$w[strlen($w)-$i-2]="";}; $f($argv[1],$argv[2]);echo"$argv[1]\n";' Hello 1
```
[Answer]
# [Pylons](https://github.com/morganthrapp/Pylons-lang), 16 Bytes.
```
i:At,{\,v\,v,A}c
```
How it works:
```
i    # Get command line input.
:At  # Set A equal to the top of the stack.
,    # Pop the stack.
{    # Start a for loop.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 \   # Swap the top two elements of the stack.
  ,  # Pop the stack.
   v # Reverse the stack.
 ,   # Switch to loop iterations.
 A   # Iterate A times.
}    # End the for loop.
c    # Print the stack as a string
```
[Answer]
# CJam, 15 bytes
```
r(\)\{(;);}ri*\
```
I'm sure it's possible to golf this further...
[Answer]
# Jolf, 13 bytes
```
ΆFi liγhj_γgi
```
A tranpilation of the JavaScript answer.
Explanation:
```
ΆFi liγhj_γgi
Ά             ternary add
 Fi            i[0],
   `li         i sliced
      γhj       γ = j + 1
         _γ     to -γ
           gi  and the last of i
```
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=zoZGaSBsac6zaGpfzrNnaQ)
A more interesting post-question version:
```
 ΆFi]ihjYgi
```
[Answer]
## Seriously, 17 bytes
```
,#,`p@pXod@dXq`nΣ
```
Takes input as `s \n n`.
[Try it online!](http://seriously.tryitonline.net/#code=LCMsYHBAcFhvZEBkWHFgbs6j&input=J0FCQ0RFRkdISUpLTE1OT1AnCjY)
Explanation:
```
,#,`p@pXod@dXq`nΣ
,#                 push a list of characters in s
  ,`          `n   do the following n times:
    p@pXo          pop 2 characters off the front, discard the second, put the first back
         d@dXq     pop 2 characters off the back, discard the second, put the first back
                Σ  join
```
]