摘要:
[抄题]: 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 阅读全文
摘要:
[抄题]: 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 阅读全文
摘要:
[抄题]: 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. 阅读全文
摘要:
[抄题]: 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 阅读全文
摘要:
[抄题]: 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 阅读全文
摘要:
[抄题]: 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 [ 阅读全文
摘要:
[抄题]: 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 [暴力解法] 阅读全文
摘要:
[抄题]: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩 阅读全文
摘要:
[抄题]: 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 阅读全文
摘要:
[抄题]: 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 阅读全文