#K70082. Count Visible Buildings
Count Visible Buildings
Count Visible Buildings
You are given a sequence of integers representing the heights of buildings arranged in a row. A building is visible from the left if its height is strictly greater than every building to its left. In other words, for a sequence of buildings with heights (h_1, h_2, \dots, h_n), the building at index (i) is visible if (h_i > \max{h_1, h_2, \dots, h_{i-1}}) (note that the first building is always visible).
The input consists of multiple test cases. The first line contains the number of test cases, (T). Each of the following (T) lines contains space-separated positive integers representing the heights of the buildings in that test case.
inputFormat
Standard Input (stdin):
(T) (an integer representing the number of test cases) on the first line, followed by (T) lines each containing a list of space-separated integers representing the heights of buildings.
outputFormat
Standard Output (stdout):
For each test case, output the number of visible buildings on a new line.## sample
2
3 7 8 3 6 1
1 2 3 4 5
3
5
</p>