当前位置:网站首页>How do I check swift if two arrays contain the same elements, regardless of the order in which they appear?
How do I check swift if two arrays contain the same elements, regardless of the order in which they appear?
2022-06-25 06:24:00 【Bustling city 】
problem :
Let's say there are two arrays... Let's say there are two arrays ...
var array1 = ["a", "b", "c"]var array2 = ["b", "c", "a"]I'd like the result of the comparison of these two arrays to be true, and the following... I hope the comparison between these two arrays is true , following ...
var array1 = ["a", "b", "c"]var array2 = ["b", "c", "a", "d"]...to be false.…… fake .How can I achieve that in Swift? How can I be in Swift To achieve this ?I tried to convert both arrays to sets but for some reason Set() keeps removing some (usually duplicated) objects that the array contains. I tried to convert two arrays into collections , But for some reason Set() Keep deleting some of the... Contained in the array ( Usually repeated ) object .
Any help would be appreciated. Any help will be appreciated .
Solution :
Reference resources : https://stackoom.com/en/question/2U37i边栏推荐
- delphi-UUID
- 2022 AI trend 8 forecast!
- Ping command – test network connectivity between hosts
- Handling skills of SQL optimization (2)
- Aviator an expression evaluation engine
- Folding mobile phones are expected to explode, or help Samsung compete with apple and Chinese mobile phones
- Global and Chinese benzoic acid market competition strategy and demand scale forecast report 2022
- Research Report on marketing channel analysis and competitive strategy of China's polycarbonate industry 2022
- Investment opportunities and operational risk assessment report of China's engineering consulting industry during the 14th Five Year Plan period 2022-2028
- What happens when redis runs out of memory
猜你喜欢

JS to determine whether an element exists in the array (four methods)

Three tier architecture experiment

MySQL tuning -- 02 -- slow query log

Location object

Digitalization, transformation?

Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033

Invalid bound statement (not found)

Laravel8 fill data

VMware virtual machine prompt: the virtual device ide1:0 cannot be connected because there is no corresponding device on the host.

Personal blog system graduation project opening report
随机推荐
C switch nested syntax
Fdisk command – disk partition
BGP - basic concept
Sword finger offer II 095 Longest common subsequence
Huawei machine test question: splicing URL
Mongodb basic concept learning - set
Invalid bound statement (not found)
[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security
An interview question record about where in MySQL
Understand what MSS is
What elements are indispensable for the development of the character? What are the stages
Research Report on demand and Competitive Prospect of global and Chinese welding personal protective equipment industry 2022-2027
Which of the top ten securities companies has the lowest Commission and is the most safe and reliable? Do you know anything
JS dynamic table creation
Optimal Parking
Es11 new methods: dynamic import(), bigint, globalthis, optional chain, and null value merging operator
Curl command – file transfer tool
[kicad image] download and installation
Copying DNA
At the age of 26, I was transferred to software testing with zero foundation. Now I have successfully entered the job with a monthly salary of 12K. However, no one understands my bitterness