摘要:
问题: 给一个数组(这一题可以有重复的数字),我们将其最多分成几块,各自进行全排序,能得到整体有序的数列? 数值大小范围增大,元素个数增多 Example 1: Input: arr = [5,4,3,2,1] Output: 1 Explanation: Splitting into two or 阅读全文
摘要:
问题: 给一个[0~size()-1]排列的一个数组,我们将其最多分成几块,各自进行全排序,能得到整体有序的数列? Example 1: Input: arr = [4,3,2,1,0] Output: 1 Explanation: Splitting into two or more chunks 阅读全文
摘要:
问题: 给定一个二维数组, 若该数组的所有\方向的对角线数值相同,则为Toeplitz矩阵,返回true,否则返回false Example 1: Input: matrix = [ [1,2,3,4], [5,1,2,3], [9,5,1,2] ] Output: True Explanation 阅读全文
摘要:
问题: 给定数组,若存在最大值是任意其他元素的2倍以上,则返回该最大值的index,否则返回-1 Example 1: Input: nums = [3, 6, 1, 0] Output: 1 Explanation: 6 is the largest integer, and for every 阅读全文