LeetCode – 268. Missing Number

LeetCode – 268. Missing Number

Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missin…

LeetCode – 169. Majority Element

LeetCode – 169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appear…

LeetCode –  219. Contains Duplicate II

LeetCode – 219. Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j…

LeetCode – 217. Contains Duplicate

LeetCode – 217. Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return t…

LeetCode – 167. Two Sum II – Input array is sorted

LeetCode – 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 the…

LeetCode – 122. Best Time to Buy and Sell Stock II

LeetCode – 122. Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i. Design an al…

LeetCode – 121. Best Time to Buy and Sell Stock

LeetCode – 121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i. If you were …

LeetCode – 88. Merge Sorted Array

LeetCode – 88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: Y…

LeetCode – 136. Single Number

LeetCode – 136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one. Note: …

LeetCode – 26. Remove Duplicates from Sorted Array

LeetCode – 26. Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and ret…

返回顶部