Test case passes 2/3
Find the greatest element
Your logic is incorrect
for input
4
1 2 1 3
Your output
2 -1 3 -1
Correct Output
2 3 3 -1
Correct Code
Test case passes 2/3
Your logic is incorrect
for input
4
1 2 1 3
Your output
2 -1 3 -1
Correct Output
2 3 3 -1
Correct Code