摘要:
Given an array of integers and an integer $k$, find out whether there are two distinct indices $i$ and $j$ in the array such that nums[i] = nums[j] an 阅读全文
摘要:
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
摘要:
189. Rotate Array Rotate an array of $n$ elements to the right by $k$ steps. For example, with $n = 7$ and $k = 3$, the array is rotated to . Related 阅读全文
摘要:
169. Majority Element Given an array of size $n$, find the majority element. The majority element is the element that appears more than times. You may 阅读全文
摘要:
167. Two Sum II Input array is sorted Given an array of integers that is already sorted in ascending order , find two numbers such that they add up to 阅读全文
摘要:
121. Best Time to Buy and Sell Stock Example 1: Example 2: 同53题. The maximum (minimum) subarray problem. 用到$DP$. 这题是重点 : 就是序列从A[0]开始计算, 不符合条件就清0, 从断处继 阅读全文