LeetCode – Contains Duplicates
Hello everyone, in this post I want to explore a solution to the Contains Duplicates LeetCode problem using Swift. Most solutions use Python and I think it would be a good idea to try to use Swift to explore how well it behaves for the LeetCode style questions.
The Problem This problem states that we have an array of integers and it may contain some values that are duplicated, so we need to write a function that check if the given array contains any element more than once.