Recursive filter with repeated poles
I assume that by "inverse Z-transform" you simply mean the impulse response of the filter.

That's much easier done in the time domain directly. The first section has an impulse response of 
$$
h_1[n] =\begin{cases}
1 &amp; \text{ if } n= 0\\ 
-1 &amp; \text{ if } x= K\\ 
0 &amp; otherwise 
\end{cases}
$$
So basically a positive spike at n=0 and a negative spike at $n = K$

The integrator picks up the first spike and keeps it until you hit the negative spike, which cancels the positive one and everything is zero again. So the resulting impulse response is a rectangular window
$$h_2[n] =\begin{cases}
1 &amp; \text{ if } 0 \leq n &lt; K \\ 
0 &amp; otherwise 
\end{cases}$$

The second half of the filter has exactly the same structure as the first half and so it produces a rectangular window of length $L$.

The overall impulse response is then simply the convolution of both rectangular windows. This will be a triangle for $K=L$ and a trapezoid otherwise. The ramps of the trapezoid have the length of the smaller of K and L and the length of the flat part is the difference between K and L. Total length is $L+K-1$ 

Assuming K is the smaller one we could write this as 

$$h[n] =\begin{cases}
n+1 &amp; \text{ if } 0 \leq n &lt; K \\ 
K &amp; \text{ if } K \leq n &lt; L \\
K-1-(n-L) &amp; \text{ if } L \leq n &lt; L+K-1 \\
0 &amp; otherwise 
\end{cases}$$