Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice.

Share

Find a peak element in an array

This algorithm to find peak element in an array, Peak element is an element which has greater value than its left and right element. one way to get peak element is using linear search which takes O(n), but we can also search using binary algo.

Share