该文被密码保护。 阅读全文
posted @ 2017-06-04 18:34 anghostcici 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
posted @ 2017-06-04 18:22 anghostcici 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 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]. Not 阅读全文
posted @ 2017-05-29 00:52 anghostcici 阅读(118) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-05-28 20:57 anghostcici 阅读(2) 评论(0) 推荐(0) 编辑
摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-05-28 20:53 anghostcici 阅读(135) 评论(0) 推荐(0) 编辑
摘要: In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2017-05-28 14:39 anghostcici 阅读(105) 评论(0) 推荐(0) 编辑
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2017-05-27 02:46 anghostcici 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: Solution: Note that there are man 阅读全文
posted @ 2017-05-24 12:23 anghostcici 阅读(134) 评论(0) 推荐(0) 编辑
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2017-05-22 00:57 anghostcici 阅读(126) 评论(0) 推荐(0) 编辑
摘要: We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra 阅读全文
posted @ 2017-05-21 21:27 anghostcici 阅读(235) 评论(0) 推荐(0) 编辑