Hackerrank | 30 days of code | Day 28-Solution in c++| RegEx-Patterns-and-Intro-to-Databases-hackerrank-Solution-in-c++


Hackerrank | 30 days of code | Day 28-Solution in c++| RegEx-Patterns-and-Intro-to-Databases-hackerrank-Solution-in-c++

Hackerrank Solution 30-days-of-code


https://www.hackerrank.com/challenges/30-regex-patterns/problem
Day 28: RegEx, Patterns, and Intro to Databases Solution in Cpp
#include <bits/stdc++.h> using namespace std; vector<string> split_string(string); int main() { list<string> names; int N; cin >> N; for(int a0 = 0; a0 < N; a0++){ string firstName; string emailID; cin >> firstName >> emailID; if ( emailID.find("@gmail.com") != std::string::npos ) { names.push_front(firstName); } } names.sort(); for (auto & name : names) { cout << name << endl; } return 0; }

Post a Comment

0 Comments