using System;
using System.Collections.Generic;
public class Program
{
//Implement an algorithm to determine if string has all unique characters. What if you cannot use additional data structure?
public static void Main()
String str = "abcdefg";
str = str.Replace(" ","");
Console.WriteLine(str);
bool flag = false;
Dictionary<char,int> s = new Dictionary<char,int>();
foreach(char c in str)
//if it in char pool does not contain unique char
if(s.ContainsKey(c))
flag = true;
}
else
s.Add(c,1);
if(flag)
Console.WriteLine("Duplicate char present ");
else{
Console.WriteLine("No Duplicate");
string st = "abc";
foreach(char c in st)
foreach(char ch in st)
Console.WriteLine(ch ^c);