Find the greter element


What’s wrong in my code.
showing 1 wrong answer

Hello @ankitdelhi20,

Your code is failing for the test cases like:

Example 1:
4 3 2 1
Expected Output:
-1 4 4 4
Your Output:
4 4 4

Example 2:
4 1 1 1
Expected Output:
-1 4 4 4
Your Output:
4 4 4

Hope, this would help.
Give a like, if you are satisfied.

Thanks. I will update my code.

@ankitdelhi20 Anytime.

Please, mark this doubt as resolved if you don’t have any issue regarding it.