Back

print the maximum of 2?

Created 2 years ago
156 Views
2 Comments
SakthivelHmOLkh
@SakthivelHmOLkh
SakthivelHmOLkh
@SakthivelHmOLkhProfile is locked. Login

Given a number N followed by N elements for every 2 consecutive numbers print the maximum of the 2.
Input Size : N <= 100000 (ie do it in O(n) time complexity)
Sample Testcase :
INPUT
5
1 1 3 0 5
OUTPUT
1 3 3 5

Comments (2)
Please login to comment.