i want to write a function that would go through an array and see if all of its elements are the same. We return true iff all the elements in the array are different from every other element. Let’s say that if the array has 0 elements, then all the elements are different.
For instance, allDifferent( {1, 5, 3, 5, 2}, 5 ) would false
For instance, allDifferent( {1, 5, 3, 80000, 2}, 5 ) would return true
here is my code but something is wrong with it. i would appreciate corrections and instructions on making my code more efficient