当前位置:网站首页>数组 只出现一次的数字
数组 只出现一次的数字
2022-06-10 20:50:00 【Morris_】
题目:只出现一次的数字
说明:给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。
- Swift
/* 题目:只出现一次的数字 说明:给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 */
func singleNums(_ nums: [Int]) -> Int {
for i in 0..<nums.count {
var sigle: Bool = true
for j in 0..<nums.count {
if (j != i && nums[i] == nums[j]) {
sigle = false
break
}
}
if (sigle) {
return nums[i]
}
}
return 0
}
边栏推荐
- Cordova Plugin /JPush PhoneGap 极光推送_本地推送_消息推送
- [1024 ways to play windows azure] 75 Fast cloud database migration seamlessly migrate alicloud RDS SQL server to azure SQL databas
- 旋转菜单3.0
- [NK] question de calcul de 51 g pour le match lunaire Bullock
- NFT版权/版税
- Introduction to abbexa bacterial genome DNA Kit
- Abbexa low sample size chicken lysozyme C (Lyz) ELISA Kit
- Shaping teenagers' comprehension ability with children's programming thinking
- Factory and strategy mode implementation scheme of coupons
- [nk] 牛客月赛51 F-平均题
猜你喜欢

AI blessing real-time interaction | analysis of zegoavatar facial expression following technology

Before we learn about high-performance computing, let's take a look at its history
![[nk] Niuke monthly competition 51 f-average question](/img/b3/c36a0032e606f38fdc2f7c4562713c.png)
[nk] Niuke monthly competition 51 f-average question
SQL Server2019安装的详细步骤实战记录(亲测可用)

Which city should I go to after I graduate from it? Which position has a high salary? Which companies have good treatment?

C language -- 3 variables for beginners

Asynchronous, thread pool (completablefuture)

C language -- 7 operators

Abbexa cell free DNA kit instructions

北大青鸟昌平校区:高中学历可以学UI吗?
随机推荐
Before we learn about high-performance computing, let's take a look at its history
How to choose the field of we media video creation?
A WPF developed Print dialog box -printdialogx
Summary of common mysql8 commands in centos7 environment
Calculus review 1
Abbexa low sample size chicken lysozyme C (Lyz) ELISA Kit
【phpstorm】 No data sources are configured to run this SQL and provide advanced c
PMP candidates, there are these places for PMP examination in Shenzhen in June 2022
自制Table錶格
Signal and system review 1
Introduction to abbexa bacterial genome DNA Kit
Leetcode advanced road - plus one
Install MySQL on Linux system. Problems encountered in xshell
Standard dual airbags, starting from 48900 for butcher Chang'an Lumin
自制Table表格
关于type-c
在Oracle表中进行关键词搜索的过程
详解MATLAB中与矩阵运算有关的算术运算符(加、减、乘、除、点乘、点除、乘方)
【MySQL】錶數據的增删查改(DML)
CentOS7安装MySQL8的超级详细教程(无坑!)