题目一 permutations 题目描述 Given a collection of numbers, return all possible permutations. For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2], and[3,2,1]. 题二解析: 这是很经典的全排列问题,本题的解法很多.因为这里的所有数都是相异的,故笔者采用了交换元素+DFS的方法…
221 medium 221. Maximal Square Medium Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Output: 4 To appy DP, we define t…