Alternating start and end points for polyline in linear array - how to?

Hi all,
Could anyone assist me with my grasshopper file. I’m attempting to generate a polyline in an array along the Z-Axis where the start and end points alternate to give me a connector between offsets along Z only, i.e connecting the end of one to the start of the next - it’s got me a bit stumped. I’ve attached my results thus far, illustrating the undesired connector in orange.


liear array (17.4 KB)


liear array (12.6 KB)

something like this?.

Check this as well.

liear array (13.6 KB)

Thanks @HS_Kim - clearly not as simple as I thought it to be. Much appreciated.