Browse Source

Site updated: 2022-08-25 11:31:51

master
nicksxs 3 years ago
parent
commit
a5bc401508
26 changed files with 5688 additions and 5664 deletions
  1. +2
    -2
      2019/06/18/openresty/index.html
  2. +1
    -1
      2020/05/31/聊聊-Dubbo-的-SPI/index.html
  3. +1
    -1
      2020/06/06/聊聊-Dubbo-的-SPI-续之自适应拓展/index.html
  4. +2
    -2
      2020/06/26/聊一下-RocketMQ-的-Consumer/index.html
  5. +2
    -2
      2020/07/05/聊一下-RocketMQ-的-NameServer-源码/index.html
  6. +2
    -2
      2020/10/25/Leetcode-104-二叉树的最大深度-Maximum-Depth-of-Binary-Tree-题解分析/index.html
  7. +2
    -2
      2020/11/15/Leetcode-234-回文联表-Palindrome-Linked-List-题解分析/index.html
  8. +2
    -2
      2020/12/13/Leetcode-105-从前序与中序遍历序列构造二叉树-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal-题解分析/index.html
  9. +2
    -2
      2021/01/10/Leetcode-160-相交链表-intersection-of-two-linked-lists-题解分析/index.html
  10. +2
    -2
      2021/01/24/Leetcode-124-二叉树中的最大路径和-Binary-Tree-Maximum-Path-Sum-题解分析/index.html
  11. +13
    -13
      baidusitemap.xml
  12. +1
    -1
      categories/Java/GC/index.html
  13. +1
    -1
      categories/Java/index.html
  14. +1
    -1
      categories/Redis/index.html
  15. +1
    -1
      categories/leetcode/java/linked-list/index.html
  16. +1
    -1
      categories/linked-list/index.html
  17. +1
    -1
      categories/php/index.html
  18. +22
    -0
      code/Solution278.java
  19. +43
    -42
      code/Solution885.java
  20. +1
    -0
      leancloud.memo
  21. +1
    -1
      leancloud_counter_security_urls.json
  22. +2
    -2
      page/25/index.html
  23. +4894
    -4894
      search.xml
  24. +686
    -686
      sitemap.xml
  25. +1
    -1
      tags/java/page/5/index.html
  26. +1
    -1
      tags/java/page/7/index.html

+ 2
- 2
2019/06/18/openresty/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
2020/05/31/聊聊-Dubbo-的-SPI/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
2020/06/06/聊聊-Dubbo-的-SPI-续之自适应拓展/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2020/06/26/聊一下-RocketMQ-的-Consumer/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2020/07/05/聊一下-RocketMQ-的-NameServer-源码/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2020/10/25/Leetcode-104-二叉树的最大深度-Maximum-Depth-of-Binary-Tree-题解分析/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2020/11/15/Leetcode-234-回文联表-Palindrome-Linked-List-题解分析/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2020/12/13/Leetcode-105-从前序与中序遍历序列构造二叉树-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal-题解分析/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2021/01/10/Leetcode-160-相交链表-intersection-of-two-linked-lists-题解分析/index.html
File diff suppressed because it is too large
View File


+ 2
- 2
2021/01/24/Leetcode-124-二叉树中的最大路径和-Binary-Tree-Maximum-Path-Sum-题解分析/index.html
File diff suppressed because it is too large
View File


+ 13
- 13
baidusitemap.xml View File

@ -89,15 +89,15 @@
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2021/09/04/%E8%81%8A%E4%B8%80%E4%B8%8B-RocketMQ-%E7%9A%84%E6%B6%88%E6%81%AF%E5%AD%98%E5%82%A8/</loc>
<loc>https://nicksxs.me/2021/10/03/%E8%81%8A%E4%B8%80%E4%B8%8B-RocketMQ-%E7%9A%84%E6%B6%88%E6%81%AF%E5%AD%98%E5%82%A8%E4%B8%89/</loc>
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2021/10/03/%E8%81%8A%E4%B8%80%E4%B8%8B-RocketMQ-%E7%9A%84%E6%B6%88%E6%81%AF%E5%AD%98%E5%82%A8%E4%B8%89/</loc>
<loc>https://nicksxs.me/2021/12/12/%E8%81%8A%E8%81%8A-Sharding-Jdbc-%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/</loc>
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2021/12/12/%E8%81%8A%E8%81%8A-Sharding-Jdbc-%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/</loc>
<loc>https://nicksxs.me/2021/09/04/%E8%81%8A%E4%B8%80%E4%B8%8B-RocketMQ-%E7%9A%84%E6%B6%88%E6%81%AF%E5%AD%98%E5%82%A8/</loc>
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
@ -585,15 +585,15 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2019/12/10/Redis-Part-1/</loc>
<loc>https://nicksxs.me/2015/03/11/Reverse-Bits/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/03/11/Reverse-Bits/</loc>
<loc>https://nicksxs.me/2015/03/13/Reverse-Integer/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/03/13/Reverse-Integer/</loc>
<loc>https://nicksxs.me/2015/01/14/Two-Sum/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -601,7 +601,7 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/01/14/Two-Sum/</loc>
<loc>https://nicksxs.me/2016/08/14/docker-mysql-cluster/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -609,11 +609,11 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2016/08/14/docker-mysql-cluster/</loc>
<loc>https://nicksxs.me/2016/10/11/minimum-size-subarray-sum-209/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2016/10/11/minimum-size-subarray-sum-209/</loc>
<loc>https://nicksxs.me/2019/12/10/Redis-Part-1/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -637,11 +637,11 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2019/09/23/AbstractQueuedSynchronizer/</loc>
<loc>https://nicksxs.me/2014/12/30/Clone-Graph-Part-I/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2014/12/30/Clone-Graph-Part-I/</loc>
<loc>https://nicksxs.me/2019/09/23/AbstractQueuedSynchronizer/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -649,11 +649,11 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/03/11/Number-Of-1-Bits/</loc>
<loc>https://nicksxs.me/2015/01/04/Path-Sum/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/01/04/Path-Sum/</loc>
<loc>https://nicksxs.me/2015/03/11/Number-Of-1-Bits/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>


+ 1
- 1
categories/Java/GC/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
categories/Java/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
categories/Redis/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
categories/leetcode/java/linked-list/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
categories/linked-list/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
categories/php/index.html
File diff suppressed because it is too large
View File


+ 22
- 0
code/Solution278.java View File

@ -0,0 +1,22 @@
public class Solution278 {
public int firstBadVersion(int n) {
// 类似于双指针法
int left = 1, right = n, mid;
while (left < right) {
// 取中点
mid = left + (right - left) / 2;
// 如果不是错误版本就往右找
if (!isBadVersion(mid)) {
left = mid + 1;
} else {
// 如果是的话就往左查找
right = mid;
}
}
// 这里考虑交界情况是在上面循环中如果 left 是好的right 是坏的那进入循环的时候 mid == left
// 然后 left = mid + 1 就会等于 right循环条件就跳出了此时 left 就是那个起始的错误点了
// 其实这两个是同一个值
return left;
}
}

+ 43
- 42
code/Solution885.java View File

@ -1,44 +1,45 @@
public lass Solution885 {
public int[][] spiralMatrixIII(int rows, int cols, int rStart, int cStart) {
int size = rows * cols;
int x = rStart, y = cStart;
// 返回的二维矩阵
int[][] matrix = new int[size][2];
// 传入的参数就是入口第一个
matrix[0][0] = rStart;
matrix[0][1] = cStart;
// 作为数量
int z = 1;
// 步进1122334 ... 螺旋矩阵的增长
int a = 1;
// 方向 1 表示右2 表示下3 表示左4 表示上
int dir = 1;
while (z < size) {
for (int i = 0; i < 2; i++) {
for (int j= 0; j < a; j++) {
// 处理方向
if (dir % 4 == 1) {
y++;
} else if (dir % 4 == 2) {
x++;
} else if (dir % 4 == 3) {
y--;
} else {
x--;
}
// 如果在实际矩阵内
if (x < rows && y < cols && x >= 0 && y >= 0) {
matrix[z][0] = x;
matrix[z][1] = y;
z++;
}
}
// 转变方向
dir++;
}
// 步进++
a++;
public class Solution885 {
public int[][] spiralMatrixIII(int rows, int cols, int rStart, int cStart) {
int size = rows * cols;
int x = rStart, y = cStart;
// 返回的二维矩阵
int[][] matrix = new int[size][2];
// 传入的参数就是入口第一个
matrix[0][0] = rStart;
matrix[0][1] = cStart;
// 作为数量
int z = 1;
// 步进1122334 ... 螺旋矩阵的增长
int a = 1;
// 方向 1 表示右2 表示下3 表示左4 表示上
int dir = 1;
while (z < size) {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < a; j++) {
// 处理方向
if (dir % 4 == 1) {
y++;
} else if (dir % 4 == 2) {
x++;
} else if (dir % 4 == 3) {
y--;
} else {
x--;
}
// 如果在实际矩阵内
if (x < rows && y < cols && x >= 0 && y >= 0) {
matrix[z][0] = x;
matrix[z][1] = y;
z++;
}
} }
return matrix;
// 转变方向
dir++;
}
// 步进++
a++;
} }
}
return matrix;
}
}

+ 1
- 0
leancloud.memo View File

@ -175,4 +175,5 @@
{"title":"Leetcode 16 最接近的三数之和 ( 3Sum Closest *Medium* ) 题解分析","url":"/2022/08/06/Leetcode-16-最接近的三数之和-3Sum-Closest-Medium-题解分析/"}, {"title":"Leetcode 16 最接近的三数之和 ( 3Sum Closest *Medium* ) 题解分析","url":"/2022/08/06/Leetcode-16-最接近的三数之和-3Sum-Closest-Medium-题解分析/"},
{"title":"Leetcode 278 第一个错误的版本 ( First Bad Version *Easy* ) 题解分析","url":"/2022/08/14/Leetcode-278-第一个错误的版本-First-Bad-Version-Easy-题解分析/"}, {"title":"Leetcode 278 第一个错误的版本 ( First Bad Version *Easy* ) 题解分析","url":"/2022/08/14/Leetcode-278-第一个错误的版本-First-Bad-Version-Easy-题解分析/"},
{"title":"一个 nginx 的简单记忆点","url":"/2022/08/21/一个-nginx-的简单记忆点/"}, {"title":"一个 nginx 的简单记忆点","url":"/2022/08/21/一个-nginx-的简单记忆点/"},
{"title":"Leetcode 885 螺旋矩阵 III ( Spiral Matrix III *Medium* ) 题解分析","url":"/2022/08/23/Leetcode-885-螺旋矩阵-III-Spiral-Matrix-III-Medium-题解分析/"},
] ]

+ 1
- 1
leancloud_counter_security_urls.json
File diff suppressed because it is too large
View File


+ 2
- 2
page/25/index.html
File diff suppressed because it is too large
View File


+ 4894
- 4894
search.xml
File diff suppressed because it is too large
View File


+ 686
- 686
sitemap.xml
File diff suppressed because it is too large
View File


+ 1
- 1
tags/java/page/5/index.html
File diff suppressed because it is too large
View File


+ 1
- 1
tags/java/page/7/index.html
File diff suppressed because it is too large
View File


Loading…
Cancel
Save