/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ ...
分类:
其他好文 时间:
2020-07-09 20:53:22
阅读次数:
74
在原有重量基础上增加一种重量的砝码,依次使用0,..., m【i】个,得到新的重量,将这些重量添加到集合中,继续重复。 import java.util.*; public class Main { static int solution(int n, int[] m, int[] x){ Set< ...
分类:
其他好文 时间:
2020-07-09 19:21:46
阅读次数:
52
mybatis之注解实现CRUD功能 步骤: 1、根据表创建pojo类 @Data @AllArgsConstructor @NoArgsConstructor public class User { private int uid; private String uname; private St ...
分类:
其他好文 时间:
2020-07-08 19:45:20
阅读次数:
54
8th 字符串转换整数 (atoi) 字符串模式匹配 这种题目极易写出臃肿的代码,我们需要明确具体的条件,并充分考虑细节。(否则会被样例虐爆) 这里有一个常用的判断溢出条件的方法,在之前的题目中也有出现。 对于正数: if(number > Integer.MAX_VALUE / 10 || (nu ...
分类:
其他好文 时间:
2020-07-08 15:02:40
阅读次数:
61
Integer s=new Integer(9); Integer t=new Integer(9); Long u=new Long(9); (s==t) 这个是错的,只要有new这个关键字,就是开辟空间,用的是引用 Integer s =9;Integer t =9;(s==t) 这个是对的,在 ...
分类:
其他好文 时间:
2020-07-08 13:48:31
阅读次数:
72
测试项目已上传到码云,可以下载:https://gitee.com/yangxioahui/aopdemo.git 具体如下: public interface Calc { Integer add(int num1,int num2); }//目标是对add 方法进行切入 @Component p ...
分类:
其他好文 时间:
2020-07-08 13:07:10
阅读次数:
52
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve ...
分类:
其他好文 时间:
2020-07-08 09:14:32
阅读次数:
54
自己收集的几个比较实用的字符串函数(LeftStr,MidStr,RightStr,Reverse,LastPos) 没什么可说的,自己看啦 //从右边取 function RightStr (Const Str: String; Size: Word): String; begin if Size ...
方法一:滑动窗口 class Solution { public List<Integer> partitionLabels(String s) { List<Integer> res = new ArrayList<>(); int[] arr = new int[128]; for(char c ...
分类:
其他好文 时间:
2020-07-07 18:10:25
阅读次数:
53
群主发普通红包。某群有多名成员,群主给成员发普通红包。普通红包的规则: 1. 群主的一笔金额,从群主余额中扣除,平均分成n等份,让成员领取。 2. 成员领取红包后,保存到成员余额中。 /** * 用户类 */public class User { private String username; p ...
分类:
其他好文 时间:
2020-07-07 18:08:28
阅读次数:
39