Created
June 30, 2018 07:01
-
-
Save paulohenriquesn/b21edbc43622d8f0a769e5aecb0fb6dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void NoFlood(string _) | |
{ | |
string value = String.Empty; | |
int? cCList,cCPointer = null; | |
int m = 0x0; | |
string[] memoryStrings = new string[124]; | |
int counter = 0; | |
char[] CharList = _.ToCharArray(); | |
for (int x = 0; x < CharList.Length; x++) | |
{ | |
if(x == 0 ) | |
{ | |
//define | |
{ | |
cCList = CharList[x]; | |
m = (int)cCList; | |
cCPointer = x; | |
} | |
}else if ( x > 0 ) | |
{ | |
cCList = m; | |
if(CharList[x-1] == cCList) | |
{ | |
if(counter == 0 ) { value += CharList[x]; counter += 1; } | |
} | |
else | |
{ | |
value += CharList[x]; | |
} | |
} | |
} | |
Console.WriteLine(value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NoFlood("aaaaaaaaaaaaaaaaaaaaaaaaaaa") returns (a)