Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
3,021 views
in Online Assessments by Expert (32,020 points)

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 (32,020 points)
...