上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 77 下一页
摘要: [抄题]: A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return True if and only if 阅读全文
posted @ 2018-04-20 21:05 苗妙苗 阅读(601) 评论(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 阅读全文
posted @ 2018-04-18 22:33 苗妙苗 阅读(257) 评论(0) 推荐(0)
摘要: [抄题]: Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. 阅读全文
posted @ 2018-04-18 16:28 苗妙苗 阅读(176) 评论(0) 推荐(0)
摘要: [抄题]: We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or  阅读全文
posted @ 2018-04-18 15:21 苗妙苗 阅读(146) 评论(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 阅读全文
posted @ 2018-04-18 10:38 苗妙苗 阅读(112) 评论(0) 推荐(0)
摘要: [抄题]: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [ 阅读全文
posted @ 2018-04-17 22:17 苗妙苗 阅读(115) 评论(0) 推荐(0)
摘要: [抄题]: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1 Example 2 [暴力解法] 阅读全文
posted @ 2018-04-17 15:14 苗妙苗 阅读(120) 评论(0) 推荐(0)
摘要: [抄题]: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩 阅读全文
posted @ 2018-04-16 15:19 苗妙苗 阅读(145) 评论(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 t 阅读全文
posted @ 2018-04-15 16:17 苗妙苗 阅读(118) 评论(0) 推荐(0)
摘要: [抄题]: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as a 阅读全文
posted @ 2018-04-15 10:28 苗妙苗 阅读(133) 评论(0) 推荐(0)
上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 77 下一页