Browse Source

Site updated: 2022-08-26 23:10:20

master
nicksxs 3 years ago
parent
commit
fcdb709514
27 changed files with 5289 additions and 5250 deletions
  1. +2
    -2
      2017/04/25/rabbitmq-tips/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/10/25/Leetcode-104-二叉树的最大深度-Maximum-Depth-of-Binary-Tree-题解分析/index.html
  5. +2
    -2
      2020/11/15/Leetcode-234-回文联表-Palindrome-Linked-List-题解分析/index.html
  6. +2
    -2
      2020/12/13/Leetcode-105-从前序与中序遍历序列构造二叉树-Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal-题解分析/index.html
  7. +2
    -2
      2021/01/10/Leetcode-160-相交链表-intersection-of-two-linked-lists-题解分析/index.html
  8. +2
    -2
      2021/01/24/Leetcode-124-二叉树中的最大路径和-Binary-Tree-Maximum-Path-Sum-题解分析/index.html
  9. +17
    -17
      baidusitemap.xml
  10. +1
    -1
      categories/Java/GC/index.html
  11. +1
    -1
      categories/Java/index.html
  12. +1
    -1
      categories/Redis/index.html
  13. +1
    -1
      categories/leetcode/java/linked-list/index.html
  14. +1
    -1
      categories/linked-list/index.html
  15. +1
    -1
      categories/php/index.html
  16. +39
    -0
      code/Solution16.java
  17. +1
    -1
      leancloud_counter_security_urls.json
  18. +2
    -2
      page/25/index.html
  19. +4497
    -4497
      search.xml
  20. +706
    -706
      sitemap.xml
  21. +1
    -1
      tags/DP/index.html
  22. +1
    -1
      tags/JVM/index.html
  23. +1
    -1
      tags/java/page/3/index.html
  24. +1
    -1
      tags/java/page/5/index.html
  25. +1
    -1
      tags/linked-list/index.html
  26. +1
    -1
      tags/mysql/index.html
  27. +1
    -1
      tags/php/index.html

+ 2
- 2
2017/04/25/rabbitmq-tips/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/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


+ 17
- 17
baidusitemap.xml View File

@ -89,19 +89,19 @@
<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/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>
<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/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/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/12/05/%E8%81%8A%E8%81%8A%E9%83%A8%E5%88%86%E5%85%AC%E4%BA%A4%E8%BD%A6%E7%9A%84%E8%AE%BE%E8%AE%A1bug/</loc>
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2021/12/05/%E8%81%8A%E8%81%8A%E9%83%A8%E5%88%86%E5%85%AC%E4%BA%A4%E8%BD%A6%E7%9A%84%E8%AE%BE%E8%AE%A1bug/</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>
@ -189,11 +189,11 @@
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2021/09/19/%E8%81%8A%E4%B8%80%E4%B8%8B-SpringBoot-%E4%B8%AD%E4%BD%BF%E7%94%A8%E7%9A%84-cglib-%E4%BD%9C%E4%B8%BA%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86%E4%B8%AD%E7%9A%84%E4%B8%80%E4%B8%AA%E6%B3%A8%E6%84%8F%E7%82%B9/</loc>
<loc>https://nicksxs.me/2021/09/26/%E8%81%8A%E4%B8%80%E4%B8%8B-SpringBoot-%E4%B8%AD%E5%8A%A8%E6%80%81%E5%88%87%E6%8D%A2%E6%95%B0%E6%8D%AE%E6%BA%90%E7%9A%84%E6%96%B9%E6%B3%95/</loc>
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2021/09/26/%E8%81%8A%E4%B8%80%E4%B8%8B-SpringBoot-%E4%B8%AD%E5%8A%A8%E6%80%81%E5%88%87%E6%8D%A2%E6%95%B0%E6%8D%AE%E6%BA%90%E7%9A%84%E6%96%B9%E6%B3%95/</loc>
<loc>https://nicksxs.me/2021/09/19/%E8%81%8A%E4%B8%80%E4%B8%8B-SpringBoot-%E4%B8%AD%E4%BD%BF%E7%94%A8%E7%9A%84-cglib-%E4%BD%9C%E4%B8%BA%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86%E4%B8%AD%E7%9A%84%E4%B8%80%E4%B8%AA%E6%B3%A8%E6%84%8F%E7%82%B9/</loc>
<lastmod>2022-06-11</lastmod> <lastmod>2022-06-11</lastmod>
</url> </url>
<url> <url>
@ -604,10 +604,6 @@
<loc>https://nicksxs.me/2016/08/14/docker-mysql-cluster/</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>
<loc>https://nicksxs.me/2016/09/29/binary-watch/</loc>
<lastmod>2020-01-12</lastmod>
</url>
<url> <url>
<loc>https://nicksxs.me/2016/10/11/minimum-size-subarray-sum-209/</loc> <loc>https://nicksxs.me/2016/10/11/minimum-size-subarray-sum-209/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
@ -617,15 +613,15 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2019/06/18/openresty/</loc>
<loc>https://nicksxs.me/2016/09/29/binary-watch/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2016/11/10/php-abstract-class-and-interface/</loc>
<loc>https://nicksxs.me/2019/06/18/openresty/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2019/12/26/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D/</loc>
<loc>https://nicksxs.me/2016/11/10/php-abstract-class-and-interface/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -637,7 +633,7 @@
<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/12/26/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -645,11 +641,11 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/04/15/Leetcode-No-3/</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/2015/01/04/Path-Sum/</loc>
<loc>https://nicksxs.me/2015/04/15/Leetcode-No-3/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
@ -657,7 +653,7 @@
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url> <url>
<loc>https://nicksxs.me/2015/06/22/invert-binary-tree/</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>
@ -684,6 +680,10 @@
<loc>https://nicksxs.me/2016/07/13/swoole-websocket-test/</loc> <loc>https://nicksxs.me/2016/07/13/swoole-websocket-test/</loc>
<lastmod>2020-01-12</lastmod> <lastmod>2020-01-12</lastmod>
</url> </url>
<url>
<loc>https://nicksxs.me/2015/06/22/invert-binary-tree/</loc>
<lastmod>2020-01-12</lastmod>
</url>
<url> <url>
<loc>https://nicksxs.me/2019/12/21/%E8%81%8A%E8%81%8AJava%E4%B8%AD%E7%9A%84%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/</loc> <loc>https://nicksxs.me/2019/12/21/%E8%81%8A%E8%81%8AJava%E4%B8%AD%E7%9A%84%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/</loc>
<lastmod>2019-12-22</lastmod> <lastmod>2019-12-22</lastmod>


+ 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


+ 39
- 0
code/Solution16.java View File

@ -0,0 +1,39 @@
public class Solution16 {
public int threeSumClosest(int[] nums, int target) {
Arrays.sort(nums);
// 当前最近的和
int closestSum = nums[0] + nums[1] + nums[nums.length - 1];
for (int i = 0; i < nums.length - 2; i++) {
if (i == 0 || nums[i] != nums[i - 1]) {
// 左指针
int left = i + 1;
// 右指针
int right = nums.length - 1;
// 判断是否遍历完了
while (left < right) {
// 当前的和
int sum = nums[i] + nums[left] + nums[right];
// 小优化相等就略过了
while (left < right && nums[left] == nums[left + 1]) {
left++;
}
while (left < right && nums[right] == nums[right - 1]) {
right--;
}
// 这里判断其实也还是希望趋近目标值
if (sum < target) {
left++;
} else {
right--;
}
// 判断是否需要替换
if (Math.abs(sum - target) < Math.abs(closestSum - target)) {
closestSum = sum;
}
}
}
}
return closestSum;
}
}

+ 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


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


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


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


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


+ 1
- 1
tags/java/page/3/index.html
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/linked-list/index.html
File diff suppressed because it is too large
View File


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


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


Loading…
Cancel
Save