上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 39 下一页
摘要: # 1. 区分大小写 ```java str1.compareTo(str2) ``` ## 2. 不区分大小写 ```java str1.compareToIgnoreCase(str2) ``` 阅读全文
posted @ 2023-09-05 11:35 爱新觉罗LQ 阅读(48) 评论(0) 推荐(0)
摘要: 定制排序 1. 冠亚军排名 import java.util.Scanner; import java.util.*; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] 阅读全文
posted @ 2023-09-05 11:32 爱新觉罗LQ 阅读(72) 评论(0) 推荐(0)
摘要: # 双端队列 ## 1. 求解连续数列 ```bash # 用例 7611 86 ``` ```java import java.util.Scanner; import java.util.*; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class 阅读全文
posted @ 2023-09-05 10:57 爱新觉罗LQ 阅读(36) 评论(0) 推荐(0)
摘要: 一种字符串压缩表示的解压 给几个用例:3bb,bbb,3b4b import java.util.Scanner; import java.util.*; import java.util.regex.*;; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public 阅读全文
posted @ 2023-09-05 00:17 爱新觉罗LQ 阅读(33) 评论(0) 推荐(0)
摘要: ![](https://img2023.cnblogs.com/blog/2171496/202309/2171496-20230904124423915-1915833590.png) 举例子 ```java Integer num1 = 10; Integer num2 = 10; System 阅读全文
posted @ 2023-09-04 12:50 爱新觉罗LQ 阅读(37) 评论(0) 推荐(0)
摘要: 滑动窗口 3. 无重复字符的最长子串 class Solution { public int lengthOfLongestSubstring(String s) { int res = 0; int l = 0; int r = 0; Map<Character, Integer> map = n 阅读全文
posted @ 2023-09-04 00:26 爱新觉罗LQ 阅读(36) 评论(0) 推荐(0)
摘要: # 二分查找 ## 标准模板 LeetCode 704 ```java class Solution { public int search(int[] nums, int target) { int left = 0; int right = nums.length - 1; while (lef 阅读全文
posted @ 2023-09-03 00:02 爱新觉罗LQ 阅读(39) 评论(0) 推荐(0)
摘要: https://chrome.google.com/webstore/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh?utm_source=ext_app_menu ![](https://img2023.cnblogs.com/blog/21 阅读全文
posted @ 2023-09-02 23:08 爱新觉罗LQ 阅读(432) 评论(0) 推荐(0)
摘要: 1. 数组种的双指针 借助一个变量做到了降维的优化 1.1 左右指针 class Solution { public int maxArea(int[] height) { int left = 0; int right = height.length - 1; int max = 0; while 阅读全文
posted @ 2023-08-31 10:59 爱新觉罗LQ 阅读(45) 评论(0) 推荐(0)
摘要: ```java int weight = (int) Math.ceil(arr[i - 1] / 512.0); // 向上取整 ``` 阅读全文
posted @ 2023-08-30 17:34 爱新觉罗LQ 阅读(104) 评论(0) 推荐(0)
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 39 下一页