摘要:
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 阅读全文
摘要:
Given an array, rotate the array to the right by k steps, where k is non-negative. 题目:给定一个数组和一个数值k,要求将数组向右旋转k步。 以前准备面试时看到过这个题目,结果今天还是记不得空间复杂度O(1)的解法,好 阅读全文
摘要:
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
摘要:
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文