摘要:
改了很多次,这种麻烦的题目就是考你有没有考虑到所有情况 1 class Solution { 2 public: 3 string simplifyPath(string path) { 4 // Start typing your C/C++ solution below ... 阅读全文
摘要:
Java: 需要注意的是,题目要求不能有额外的空间,因此我们需要在矩阵上进行操作,不能直接将行和列置0,因此我们需要存储各行列的状态,但是首行首列的状态不能存在matrix[0][0]中,需要两个boolean变量来存储,而这两个boolean变量的初值则是matrix[0][0] == 0 阅读全文
摘要:
一次过 1 class Solution { 2 public: 3 int searchInsert(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 //... 阅读全文
摘要:
搞了很久始终没通过,看了网上的简单答案,这道题的关键在于看target处于哪段递增区间里 1 class Solution { 2 public: 3 bool search(int A[], int n, int target) { 4 // Start typing yo... 阅读全文
摘要:
少数次过 1 class Solution { 2 public: 3 int search(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 // DO N... 阅读全文