**Compilation/Execution Result:**

Given n non-negative integers in array representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.

For example:

Input:

3

2 0 2

Output:

2

Structure is like below

| |

|_|

We can trap 2 units of water in the middle gap.

Below is another example.

**Input:**

The first line of input contains an integer T denoting the number of test cases. The description of T test cases follows.

Each test case contains an integer N followed by N numbers to be stored in array.

**Output:**

Print trap units of water in the middle gap.

**Constraints:**

1<=T<=100

3<=N<=100

0<=Arr[i]<10

**Example:
Input:**

2

4

7 4 0 9

3

6 9 9

10

0

Pulkit Gupta 2 | 130 |

Relentless | 124 |

Ibrahim Nash | 94 |

nancygarg258_pec | 90 |

darkswordsman | 90 |

Ibrahim Nash | 602 |

KartikAgarwal | 541 |

rs119574 | 371 |

surbhi_7 | 356 |

Little Noah | 335 |

akhayrutdinov | 4261 |

sanjay05 | 3633 |

Ibrahim Nash | 3162 |

Quandray | 3028 |

Michael Riegger | 2359 |