Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,357 views
in Online Assessments by Expert (34,270 points) | 1,357 views

1 Answer

0 like 0 dislike

I solved this using O(n^2) approach by storing elements which are bigger than the present element for both right and left. Any other creative solutions are appreciated.
image

by Expert (34,270 points)