摘要: 描述 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. 阅读全文
posted @ 2017-05-08 22:35 larryking 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 描述 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] and t 阅读全文
posted @ 2017-05-08 22:34 larryking 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 描述 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 阅读全文
posted @ 2017-05-08 22:33 larryking 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 描述 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Given nums = [0, 阅读全文
posted @ 2017-05-08 22:06 larryking 阅读(119) 评论(0) 推荐(0) 编辑