Skip to content

Instantly share code, notes, and snippets.

@bernatfortet
Created April 30, 2013 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernatfortet/5492173 to your computer and use it in GitHub Desktop.
Save bernatfortet/5492173 to your computer and use it in GitHub Desktop.
Algorithms
using System;
namespace Dela.Mono.Examples
{
public class HelloWorld
{
public static void Main(string[] args)
{
string str = Console.ReadLine();
bool hasUniqueChars = true;
for( int iCount = 0; iCount < str.Length; iCount++ ){
//Console.WriteLine( iCount + " -----" );
for( int rCount = iCount+1; rCount < str.Length; rCount++ ){
//Console.WriteLine( str[iCount] + " | " + str[rCount] );
//Console.WriteLine( str[iCount] == str[rCount] );
if( str[iCount] == str[rCount] ){
hasUniqueChars = false;
Console.WriteLine( hasUniqueChars );
return;
}
}
}
Console.WriteLine( hasUniqueChars );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment