You are given an int variable k , an int array zipcodeList that has been declared and initialized , an int variable nZips that contains the number of elements in zipcodeList , and a bool variable duplicates .
Write some code that assigns true to duplicates if there are two adjacent elements in the array that have the same value , and that assigns false to duplicates otherwise.
Use only k , zipcodeList , nZips , and duplicates .
duplicates is a boolean. Why are you comparing an int to a bool? O.O
You have the general structure of the solution done, it's just that the bounds of your for loop need to be smaller (which side is smaller doesn't matter) and what you're comparing zipcodeList[k] to needs to be different.