You can compare an element of an array with all the other elements by iterating through the array using a loop and comparing the element at the desired index with every other element in the array. Here's an example in Swift:
main.swift255 chars11 lines
gistlibby LogSnag