Print a Wavy String Line-by-Line Challenge
Write a program or function that takes in a string s and integer n as parameters. Your program should print (or return) the string when transformed as follows:
Starting in the top-left and moving down and to the right, write s as a wave of height n. Then, from top to bottom, combine each row as a string (without spaces).
Example
Given the string &quot;WATERMELON&quot; and a height of 3:
The wave should look like this:
W   R   O
 A E M L N
  T   E

Then, combine the rows from top to bottom:
WRO
AEMLN
TE

So, your program should return the string &quot;WROAEMLNTE&quot;
Likewise, &quot;WATERMELON&quot; with height 4 should produce the following wave:
W     E
 A   M L
  T R   O
   E     N

Your program should then return the string &quot;WEAMLTROEN&quot;
Rules
Input
Input can be taken in any reasonable format. The string can be in any case you prefer. You may assume that 0 &lt; n &lt;= s.length
Output
Output should consist only of the transformed string (whether returned or printed to STDOUT), plus any trailing newlines.
Scoring
This is code-golf, so shortest answer in bytes wins! Standard loopholes are not allowed.
Test Cases
Input                        Output

programmingpuzzles, 5 -&gt;     piermnlsomgzgapzru
codegolf, 3           -&gt;     cgoeofdl
elephant, 4           -&gt;     enlatehp
1234567, 3            -&gt;     1524637
qwertyuiop, 1         -&gt;     qwertyuiop
MATL, 16 bytes

Zv3L)t?yn:)2$S}i


Try it online! Or verify all test cases.

Explanation

Consider inputs 5, 'programmingpuzzles'.

Zv     % Input, implicit: number n. Symmetric range
       % STACK: [1 2 3 4 5 4 3 2 1]
3L     % Push [1 -1+1j]. When used as an index, this means 1:end-1
       % STACK: [1 2 3 4 5 4 3 2 1], [1 -1+1j]
)      % Index. Removes last element
       % STACK: [1 2 3 4 5 4 3 2]
t      % Duplicate
       % STACK: [1 2 3 4 5 4 3 2], [1 2 3 4 5 4 3 2]
?      %   If non-empty and non-zero
       %   STACK: [1 2 3 4 5 4 3 2]
  y    %   Implict input: string s. Duplicate from below
       %   STACK: 'programmingpuzzles', [1 2 3 4 5 4 3 2], 'programmingpuzzles'
  n    %   Number of elements
       %   STACK: 'programmingpuzzles', [1 2 3 4 5 4 3 2], 18
  :    %   Range
       %   STACK: 'programmingpuzzles', [1 2 3 4 5 4 3 2], [1 2 3 ··· 17 18]
  )    %   Index modularly
       %   STACK: 'programmingpuzzles', [1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2]
  2$S  %   Two-input sort: stably sorts first input as given by the second
       %   STACK: 'piermnlsomgzgapzru'
}      % Else. This branch is entered when n=1. The stack contains an empty array
       %   STACK: []
  i    %   Take input
       %   STACK: [], [], 'programmingpuzzles'
       % End, implicit
       % Display stack, implicit. Empty arrays are not displayed