Hi everyone,

Does anyone know how to tell if all elements in an array but one are the same. I know how to check if all elements are the same but this other problem has me stumped.

Any ideas would be great

Thanks

Compare them one by one. Count how many times there is a mismatch. If it's two or less, there's only one different value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.