문제 출처: https://leetcode.com/problems/contains-duplicate/
func containsDuplicate(_ nums: [Int]) -> Bool {
var result = Bool()
for i in 0..<nums.count {
if nums.firstIndex(of: nums[i]) == nums.lastIndex(of: nums[i]) {
result = false
} else {
result = true
}
}
return result
}