Skip to content

Instantly share code, notes, and snippets.

@paulohenriquesn
Created June 30, 2018 07:01
Show Gist options
  • Save paulohenriquesn/b21edbc43622d8f0a769e5aecb0fb6dc to your computer and use it in GitHub Desktop.
Save paulohenriquesn/b21edbc43622d8f0a769e5aecb0fb6dc to your computer and use it in GitHub Desktop.
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);
}
@paulohenriquesn
Copy link
Author

NoFlood("aaaaaaaaaaaaaaaaaaaaaaaaaaa") returns (a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment