The maximum of the sequence

The maximum of the sequence. A sequence consists of integer numbers and ends with the number 0. Determine the largest element in the sequence.

Test Case Input (Sequence) Expected Output
1 1
2
3
0
3
2 4
0
1
2
4
3 7
3
5
0
7