keshavsingh4522 / hacktoberfest

Submit Just 4 PRs to earn SWAGS and Tshirts🔥
https://hacktoberfest.digitalocean.com/
Creative Commons Zero v1.0 Universal
860 stars 4.03k forks source link

Feature: Solution for find peak element #1791

Open Aryan-Srivastava opened 3 years ago

Aryan-Srivastava commented 3 years ago

Problem -

A peak element is an element that is strictly greater than its neighbors.

Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.

You may imagine that nums[-1] = nums[n] = -∞.

You must write an algorithm that runs in O(log n) time.

Describe the solution you'd like

will be adding the java solution for the above problem.

ghost commented 3 years ago

can i work on this issue please assing me if possible i would love to contribute in this