上一页 1 2 3 4 5 6 7 ··· 15 下一页
摘要: 1 阅读全文
posted @ 2023-10-29 16:42 樱圃 阅读(5) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param arr int整型一维数组 the array * @return int整型 */ public 阅读全文
posted @ 2023-10-29 11:00 樱圃 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #get the first file filename=$1 grep -E -o "\b[[:alpha:]]+\b" $filename | awk ' { count[$0]++ } END{printf("%-20s%s\n","Word","Count"); for(word in co 阅读全文
posted @ 2023-10-29 00:28 樱圃 阅读(6) 评论(0) 推荐(0) 编辑
摘要: @Override public int compare(String a, String b) { // 返回正数表示要交换,正常为b+a,即大的放前 // 由小到大排序(前者减去后者) // 由大到小排序(后者减去前者) String r1=a+b; String r2=b+a; return 阅读全文
posted @ 2023-10-29 00:12 樱圃 阅读(34) 评论(0) 推荐(0) 编辑
摘要: class Solution { public String reverseWords(String s) { StringBuffer ret = new StringBuffer(); int length = s.length(); int i = 0; while(i < length){ 阅读全文
posted @ 2023-10-29 00:05 樱圃 阅读(3) 评论(0) 推荐(0) 编辑
摘要: public static int[] advantageCount(int[] A,int[] B){ int[] sortB = B.clone(); Arrays.sort(sortB); Arrays.sort(A); Map<Integer, Deque<Integer>> bMap = 阅读全文
posted @ 2023-10-28 23:50 樱圃 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 给定数组的最长严格上升子序列的长度。 * @param arr int整型一维数组 给定的数组 * @return i 阅读全文
posted @ 2023-10-28 22:37 樱圃 阅读(2) 评论(0) 推荐(0) 编辑
摘要: public boolean checkPerfectNumber(int num) { if (num == 1) return false; int sum = 1; for (int i = 2; i <= num / i; i++) { if (num % i == 0) { sum += 阅读全文
posted @ 2023-10-28 21:27 樱圃 阅读(3) 评论(0) 推荐(0) 编辑
摘要: package com.exe4.offer; import java.util.Stack; /** * 前序、中序、后序遍历方法 * @author WGS * */public class BianliOfBinarryTree { public static class TreeNode { 阅读全文
posted @ 2023-10-12 20:41 樱圃 阅读(2) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean isValid(String s) { int length; do { length = s.length(); s = s.replace("()", "").replace("{}", "").replace("[] 阅读全文
posted @ 2021-09-28 23:10 樱圃 阅读(21) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 15 下一页