From d1c11740b1f4d94045b48d5780e1b4b4cabfef60 Mon Sep 17 00:00:00 2001 From: Cool <747682928@qq.com> Date: Mon, 30 Sep 2024 03:21:24 +0800 Subject: [PATCH] =?UTF-8?q?2024/9/29=20=E5=A5=87=E6=8A=80=E6=B7=AB?= =?UTF-8?q?=E5=B7=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hot100/strange_skills_cunning/Num136.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/main/java/com/cool/hot100/strange_skills_cunning/Num136.java diff --git a/src/main/java/com/cool/hot100/strange_skills_cunning/Num136.java b/src/main/java/com/cool/hot100/strange_skills_cunning/Num136.java new file mode 100644 index 0000000..f9966b1 --- /dev/null +++ b/src/main/java/com/cool/hot100/strange_skills_cunning/Num136.java @@ -0,0 +1,23 @@ +package com.cool.hot100.strange_skills_cunning; + +/** + * Created with IntelliJ IDEA. + * + * @Author: Cool + * @Date: 2024/09/30/3:20 + * @Description: 136. 只出现一次的数字 + * Hard 1 + * Level 3 + * DayNumber 4 + * @link https://leetcode.cn/problems/single-number/description/?envType=study-plan-v2&envId=top-100-liked + */ +public class Num136 { + //位运算 + public int singleNumber(int[] nums) { + int res=0; + for(int num:nums){ + res^=num; + } + return res; + } +}