一个整型数组 nums 里除两个数字之外,其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。 示例 1: 输入:nums = [4,1,4,6]输出:[1,6] 或 [6,1]示例 2: 输入:nums = [1,2,10,4,1,4,3,3] ...
分类:
编程语言 时间:
2020-07-07 00:38:50
阅读次数:
74
System类 示例代码: public class Demo3 { public static void main(String[] args) { //arrayCopy 数组复制 int[] src = {12, 34, 45, 56, 67, 45}; int[] dest = new in ...
分类:
其他好文 时间:
2020-07-06 20:00:11
阅读次数:
61
public String save(@Validated BzDitch//时间 bzDitch) { if(bzDitch.getIsNewRecord()){ bzDitch.setDitTime(new Date()); } bzDitchService.save(bzDitch); ret ...
分类:
其他好文 时间:
2020-07-06 19:56:51
阅读次数:
78
java.util.List 分段 使用google的guava类库对List分段处理 List<Integer> intList = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8); List<List<Integer>> subSets = Lists.pa ...
分类:
编程语言 时间:
2020-07-06 18:02:38
阅读次数:
74
一、equals()方法和hashCode()方法是什么? equals()和hashCode()都是是Java中万物之源Object类中的方法; equals方法用于比较两个对象是否相同,Object类中equals方法的实现是比较引用地址来判断的对象是否是同一个对象,通过覆盖该方法可以实现自定义 ...
分类:
编程语言 时间:
2020-07-06 16:02:43
阅读次数:
64
Delphi 判断字符串是否是数字、大小字母、小写字母、纯字母组成 //判断字符串是否是数字 ,返回布尔值 function IsNumberic(Vaule:String):Boolean; var i:integer; begin result:=true; //设置返回值为 是(真) Vaul ...
JDBC连接数据库实例 1、 数据库表 1.1、创建表 CREATE TABLE `users`( `uid` INT NOT NULL AUTO_INCREMENT COMMENT '用户id', `uname` VARCHAR(20) NOT NULL COMMENT '用户名', `upass ...
分类:
数据库 时间:
2020-07-06 13:14:28
阅读次数:
70
B - Brexit Negotiations https://vjudge.net/problem/Gym-102483B 描述: As we all know, Brexit negotiations are on their way—but we still do not know wheth ...
分类:
其他好文 时间:
2020-07-06 12:29:36
阅读次数:
66
1.1 列表和元组 1、列表基本操作 1. 列表赋值 a = [1,2,3,4,5,6,7,8] a[0] = 100 #the result : [100, 2, 3, 4, 5, 6, 7, 8] 2. 元素删除 a = [1,2,3,4,5,6,7,8] del a[0] #the resul ...
分类:
编程语言 时间:
2020-07-06 10:42:50
阅读次数:
57
给定两个以字符串形式表示的非负整数 num1 和 num2,返回 num1 和 num2 的乘积,它们的乘积也表示为字符串形式。 示例 1: 输入: num1 = "2", num2 = "3" 输出: "6" 示例 2: 输入: num1 = "123", num2 = "456" 输出: "56 ...
分类:
其他好文 时间:
2020-07-05 20:52:07
阅读次数:
49