You are given an int variable k ,an int array zipcodeList that has been declared
ID: 3609818 • Letter: Y
Question
You are given an int variable k ,an int array zipcodeList that has been declared andinitialized, an int variable nZips that contains the number of elementsin zipcodeList , and a bool variable duplicates .Write some code that assigns true to duplicates if there are two adjacent elements inthe array that have the same value, and that assigns false to duplicates otherwise.
Use only k , zipcodeList, nZips , and duplicates.
Instructor's notes: Set duplicates to false tobegin with. Then search the array from the first element to thesecond-to-last element. Compare the value in the element denoted ink with that at k+1, if theycontain the same value then set duplicates totrue.