how to create a method to increment all duplicate element expect the first in a sorted array until obtain an array without any duplication items for example array={1,2,3,3,4,4} the solution: like this array={1,2,3,4,4,4} array={1,2,3,4,5,4} array={1,2,3,4,5,5} array={1,2,3,4,5,6}
2/25/2018 7:50:24 PM
Zeyad Sharo1 Answer
New Answerbool success = false; while(!success) { success = true; foreach(int n in [array]) { if([array].Contains(n)) { n++; success = false; } } something like this? ;) replace [array] with the name of your array. Syntax errors might be included.
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message