当前位置:网站首页>Array union set
Array union set
2022-06-10 22:11:00 【Morris_】
Find the union of two arrays
- Swift
let nums1: [Int] = [1, 2, 2, 3, 4]
let nums2: [Int] = [2, 3, 2]
let nums = union(nums1, nums2)
print(nums)
func union(_ nums1: [Int], _ nums2: [Int]) -> [Int] {
var nums: [Int] = []
for i in 0..<nums1.count {
for j in 0..<nums2.count {
if nums1[i] == nums2[j] {
if nums.contains(nums1[i]) {
}
else {
nums.append(nums1[i])
}
break
}
}
}
return nums
}

边栏推荐
- NFT copyright / royalties
- C use s7 Net connected to Siemens s1200plc, C # directly connected to Siemens PLC
- C中字符串查找
- SoC development environment and hardware development preparation
- About type-C
- 字符串 反转
- C language -- 4 first-time constant
- Factory and strategy mode implementation scheme of coupons
- 目标检测相关概念的理解
- CentOS7环境下MySQL8常用命令小结
猜你喜欢

NFT copyright / royalties
![[nk] 牛客月赛51 F-平均题](/img/b3/c36a0032e606f38fdc2f7c4562713c.png)
[nk] 牛客月赛51 F-平均题

2022-06-09 RK817 PMU 电池温度检测

Exec function of PHP

C language - quick sorting in sorting

Constructing the implementation strategy of steam education for children
CentOS7安装MySQL8的超级详细教程(无坑!)
![[1024 ways to play windows azure] 75 Fast cloud database migration seamlessly migrate alicloud RDS SQL server to azure SQL databas](/img/00/798455f2db289e3aaed36981ea1e7c.png)
[1024 ways to play windows azure] 75 Fast cloud database migration seamlessly migrate alicloud RDS SQL server to azure SQL databas

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

C#使用S7.net连接西门子S1200PLC,C#直接连接西门子PLC
随机推荐
Abbexa 8-OHdG CLIA kit solution
Naturalspeech model synthetic speech achieves human speech level for the first time in CMOS test
Detailed steps and actual records of SQL server2019 installation (available for hands-on test)
AI blessing real-time interaction | analysis of zegoavatar facial expression following technology
An analysis of SQL query optimization principle (900w+ data from 17s to 300ms)
C language ---9 first knowledge of macros and pointers
C程序实例1--个人通讯录管理系统
防抖和节流
Rotate menu 2.0
[nk] 牛客月赛51 F-平均题
Apple zoom! It's done so well
Share this great God's WPF interface design series video
变量(自动变量、静态变量、寄存器变量、外部变量)与C的内存分配malloc/free、calloc/recalloc
. Net open source free lunch is over?
In 2021, the average salary will be released, and the IT industry will not be surprised
Extracting Nalu unit data from H264 real-time stream
Share some information I accumulated when I was working as a dotnet9 blog site
旋转导航栏
数组 两数之和
A WPF developed Print dialog box -printdialogx