Password Rules help!
I cAnt tHE BUG, TEST CASE HIDDEN. static void Main(string[] args) { string password = Console.ReadLine(); char[] notAllowedSymbols = { '!', '#', '$', '%', '&', '(', ')', '*', ',', '+', '-' }; //your code goes here char[] p = new char[100]; for (int i = 0;i< password.Length; i++) { p[i]= Convert.ToChar(password.Substring(i,1)); } for (int k = 0; k < p.Length; k++) { for (int j = 0; j<notAllowedSymbols.Length; j++) { if(p[k]==notAllowedSymbols[j]) { Console.Write("Invalid"); break; } } } Console.Write(""); }