2022年3月23日
摘要: package leetcode; public class offer_56_2 { public int singleNumber(int[] nums) { //用一个数组记录每一位出现的次数,如果出现三次那一定是三的倍数,取余后就是当前值 int[] arr=new int[32]; for 阅读全文
posted @ 2022-03-23 21:13 一仟零一夜丶 阅读(19) 评论(0) 推荐(0)
摘要: package leetcode; public class offer_56_1 { public int[] singleNumbers(int[] nums) { int temp=0; //找出两个不同数的异或值 for(int num:nums) { temp=temp^num; } // 阅读全文
posted @ 2022-03-23 11:34 一仟零一夜丶 阅读(17) 评论(0) 推荐(0)