Given an array of integers, find the nearest greater element to the left for each element. If no such element exists, consider it -1.
{
"arr": [
1,
3,
2,
4
]
}[
-1,
-1,
3,
-1
]{
"arr": [
11,
13,
21,
3
]
}[
-1,
-1,
-1,
21
]{
"arr": [
4,
5,
2,
25
]
}[
-1,
-1,
5,
-1
]Sign in to Run Code and Submit