Challenge Information

Title : Left and Right
Difficulty : Easy
Solutions : 8
Maximum Score : 50
Completed by You: No
Description :

You are given an unsorted array containing positive integers. In this array, find the first element where all of its left elements are smaller and all the right elements are greater.

Write a function solve that have the following parameter(s):
1.) arr = array of integers

Example
Input:
arr = [2,0,8,9]
Output:
The function will return,
8

Explanation
Elements on left of 8 are smaller than it and 9 is on the right of 8 which is greater than it.

Constraints

Judocode