[LeetCode] 162. Find Peak Element A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return 2019-11-04 #leetcode #java #javascript #binary search
[LeetCode] 34. Find First and Last Position of Element in Sorted Array Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an a 2019-11-04 #leetcode #java #javascript #array #binary search
[LeetCode] 11. Container With Most Water You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-a 2019-11-02 #leetcode #java #javascript #array #two pointer
53. Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. Example 1:Input: n 2019-11-01 #leetcode #java #array #dynamic programming
[LeetCode] 253. Meeting Rooms II Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. Example 1:Input: intervals = [[0,30],[5,10],[1 2019-11-01 #leetcode #java #javascript #array #heap #line sweep
[LeetCode] 252. Meeting Rooms Given an array of meeting time intervals where intervals[i] = [start, end], determine if a person could attend all meetings. Example 1:Input: intervals = [[0,30],[5,10],[15,20]]Output: false 2019-10-31 #leetcode #java #javascript #array #line sweep
[LeetCode] 35. Search Insert Position Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algori 2019-10-30 #leetcode #java #javascript #binary search
[LeetCode] 274. H-Index Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index. According to the definition of h-index on Wikipedia: “A sci 2019-10-29 #leetcode #java #javascript #counting sort #binary search
[LeetCode] 283. Move Zeroes Given an integer array nums, move all 0’s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Exampl 2019-10-23 #leetcode #java #javascript #array #two pointer
[LeetCode] 187. Repeated DNA Sequences The DNA sequence is composed of a series of nucleotides abbreviated as ‘A’, ‘C’, ‘G’, and ‘T’. For example, “ACGAATTCCG” is a DNA sequence. When studying DNA, it is useful to identify repeated sequenc 2019-10-17 #leetcode #java #javascript #hashmap #string