Deja Vu solution not quite working
I know there are other ways, but is this a viable way to solve the Deja Vu code coach problem? It currently isn't working. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string input = Console.ReadLine(); string modInput = null; bool dejaBool = false; foreach (char c in input ) { char tempChar = c; modInput = input.Remove(input.IndexOf(c)); if (modInput.Contains(tempChar)) { dejaBool = true; } } if (dejaBool ==true) Console.WriteLine("Deja Vu"); else {Console.WriteLine ("Unique");} } } }