Hi there ,
I am new to programming and I was wondering if there was a way to
reduce adjacent pairs in an array
int[] numbers = {1,1,1,1,1,1,1,1,1,1,1,1 2,2,2,2,2,2, 3,3, 4, 5, 4, 5};
into 1,2,3,4,5,4,5??
I’ve tried searching for tutorials but to no avail
could I convert the array into a string and use some sort of a loop which includes length -1 to remove the extra characters or maybe a union would be more appropriate to merge the extra characters