You are viewing a single comment's thread. Return to all comments →
c#
class Solution { public static void Main(string[] args) { int N = Convert.ToInt32(Console.ReadLine().Trim());
List<string> l= new(); for (int NItr = 0; NItr < N; NItr++) { string[] firstMultipleInput = Console.ReadLine().TrimEnd().Split(' '); string firstName = firstMultipleInput[0]; string emailID = firstMultipleInput[1]; if(!l.Any(i=>i==emailID) && Regex.Match(emailID, "@gmail.com").Success) { l.Add(firstName); } } foreach(var e in l.Order()) { Console.WriteLine(e); } }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 28: RegEx, Patterns, and Intro to Databases
You are viewing a single comment's thread. Return to all comments →
c#
class Solution { public static void Main(string[] args) { int N = Convert.ToInt32(Console.ReadLine().Trim());
}