We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 28: RegEx, Patterns, and Intro to Databases
Day 28: RegEx, Patterns, and Intro to Databases
Sort by
recency
|
646 Discussions
|
Please Login in order to post a comment
c#
class Solution { public static void Main(string[] args) { int N = Convert.ToInt32(Console.ReadLine().Trim());
}
C#
using System.Text.RegularExpressions;
int N = int.Parse(Console.ReadLine()); List names = new List();
Regex gmailPattern = new Regex(@"@gmail.com$");
for (int i = 0; i < N; i++) { var parts = Console.ReadLine().Split(' '); string firstName = parts[0]; string emailID = parts[1];
}
foreach (var name in names.OrderBy(n => n)) Console.WriteLine(name);
Using Python and RegEx
in python code: . . . . . . . . if name == 'main': N = int(input().strip()) gmail = []
for N_itr in range(N): first_multiple_input = input().rstrip().split()
gmail.sort()
for name in gmail: print(name)
python 3 solution: