当前位置:网站首页>A number that appears only once in an array
A number that appears only once in an array
2022-06-10 22:11:00 【Morris_】
subject : A number that appears only once
explain : Given an array of non-empty integers , Except that an element only appears once , Each of the other elements occurs twice . Find the element that only appears once .
- Swift
/* subject : A number that appears only once explain : Given an array of non-empty integers , Except that an element only appears once , Each of the other elements occurs twice . Find the element that only appears once . */
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
}
边栏推荐
- Notes to entry: do I need to know programming for O & M?
- C#使用S7.net连接西门子S1200PLC,C#直接连接西门子PLC
- [NK] question de calcul de 51 g pour le match lunaire Bullock
- MySQL insère les résultats de la requête dans une autre table
- NFT版权/版税
- 【phpstorm】 No data sources are configured to run this SQL and provide advanced c
- php的exec函数
- 数组 从指定长度位旋转数组
- 变量(自动变量、静态变量、寄存器变量、外部变量)与C的内存分配malloc/free、calloc/recalloc
- 2022-06-09 RK817 PMU 電池溫度檢測
猜你喜欢

oc swift 混编

Junior high school graduates who choose secondary vocational schools can also be promoted to institutions of higher learning

Standard dual airbags, starting from 48900 for butcher Chang'an Lumin

ICML2022 | Sharp-MAML:锐度感知的模型无关元学习
![[nk] 牛客月赛51 F-平均题](/img/b3/c36a0032e606f38fdc2f7c4562713c.png)
[nk] 牛客月赛51 F-平均题

2022-06-09 RK817 PMU 電池溫度檢測

Factory and strategy mode implementation scheme of coupons

Naturalspeech model synthetic speech achieves human speech level for the first time in CMOS test

Introduction to ZigBee module wireless transmission star topology networking structure

C language -- 11 branch statement if else
随机推荐
如何激发文化创新的活力和驱动力
A WPF developed Print dialog box -printdialogx
PMP candidates, there are these places for PMP examination in Shenzhen in June 2022
Which city should I go to after I graduate from it? Which position has a high salary? Which companies have good treatment?
NFT版权/版税
磁盘序列号,磁盘ID,卷序列号的区别
Rotate navigation bar
2022-06-09 RK817 PMU 电池温度检测
Rotate menu 3.0
sql server行转列(pivot),列转行(unpivot)
Qingniao Changping campus of Peking University: can I learn UI with a high school degree?
[1024 ways to play windows azure] 75 Fast cloud database migration seamlessly migrate alicloud RDS SQL server to azure SQL databas
Acl2022 | bert2bert: an efficient pre training method of parameter reuse, which significantly reduces the training cost of oversized models
数组 从指定长度位旋转数组
【Microsoft Azure 的1024种玩法】七十五.云端数据库迁移之快速将阿里云RDS SQL Server无缝迁移到Azure SQL Databas
Concept and use of CEPH distributed storage cluster pool resource pool
Self made table
[NK] question de calcul de 51 g pour le match lunaire Bullock
oc swift 混编
Shell implements SSH login and executes commands