keshavsingh4522 / hacktoberfest

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

Feature: Solution for find peak element #1791

Open Aryan-Srivastava opened 2 years ago

Aryan-Srivastava commented 2 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 2 years ago

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