chapter2_array_matrix_algorithm
矩阵类算法
[TOC]
1. 把数组中的 0 移到末尾
1 | def moveZeroes(): |
2. 改变矩阵维度
1 | import numpy as np |
3. 找出数组中最长的连续
1 | def findMaxConsecutiveOnes(): |
4. 搜索二维矩阵 II
1 | def searchMatrix(): |
5. 有序矩阵的 Kth Element
1 | def kthSmallest(): |
6. 一个数组元素在 [1, n] 之间,其中一个数被替换为另一个数,找出重复的数和丢失的数
1 | def findErrorNums(): |
7. 找出数组中重复的数,数组值在 [1, n] 之间
1 | def findDuplicate(): |
8. 数组相邻差值的个数
1 | def constructArray(): |
9. 数组的度
1 | def findShortestSubArray(): |
10. 对角元素相等的矩阵
1 | def isToeplitzMatrix(): |
11. 分隔数组
1 | def arrayNesting(): |
12. 嵌套数组
1 | def maxChunksToSorted(): |