Hello Programmers/Coders, Today we are going to share solutions of Programming problems of 30 Days Of Code, HackerRank. At Each Problem with Successful submission with all Test Cases Passed, you will get an score or marks. And after solving maximum problems, you will be getting stars. This will highlight your profile to the recruiters.
In this post, you will find the solution for Day 28: RegEx, Patterns, and Intro to Databases in Java-HackerRank Problem. We are providing the correct and tested solutions of coding problems present on HackerRank. If you are not able to solve any problem, then you can take help from our Blog/website.
Use โCtrl+Fโ To Find Any Questions Answer. & For Mobile User, You Just Need To Click On Three dots In Your Browser & You Will Get A โFindโ Option There. Use These Option to Get Any Random Questions Answer.
Link for the Problem – Day 28: RegEx, Patterns, and Intro to Databases โ Hacker Rank Solution
Day 28: RegEx, Patterns, and Intro to Databases โ Hacker Rank Solution
Problem:
Objective
Today, we’re working with regular expressions. Check out the Tutorial tab for learning materials and an instructional video!
Task
Consider a database table, Emails, which has the attributes First Name and Email ID. Given rows of data simulating the Emails table, print an alphabetically-ordered list of people whose email address ends in .
Input Format
The first line contains an integer, , total number of rows in the table.
Each of the subsequent lines contains space-separated strings denoting a person’s first name and email ID, respectively.
Constraints
- Each of the first names consists of lower case letters only.
- Each of the email IDs consists of lower case letters , and only.
- The length of the first name is no longer than 20.
- The length of the email ID is no longer than 50.
Output Format
Print an alphabetically-ordered list of first names for every user with a gmail account. Each name must be printed on a new line.
Sample Input
6 riya riya@gmail.com julia julia@julia.me julia sjulia@gmail.com julia julia@gmail.com samantha samantha@gmail.com tanya tanya@gmail.com
Sample Output
julia julia riya samantha tanya
Day 28: RegEx, Patterns, and Intro to Databases โ Hacker Rank Solution
import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Day28RegExPatternsAndIntroToDatabases { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); List<String> list = new ArrayList<String>(); for (int a0 = 0; a0 < N; a0++) { String firstName = in.next(); String emailID = in.next(); String regExPattern = "[a-z].@gmail.com"; Pattern p = Pattern.compile(regExPattern); Matcher m = p.matcher(emailID); if (m.find()) { list.add(firstName); } } Collections.sort(list); for (String string : list) { System.out.println(string); } in.close(); } }
Iโm not that much of a internet reader to be honest but your
sites really nice, keep it up! I’ll go ahead and bookmark your website to come back later on. Cheers
Look At Amazin News Website Daily Worldwide [url=https://sepornews.xyz]Daily Worldwide News[/url]
cheap tadalafil pills tadalafil 20mg us best otc ed pills
brand duricef purchase cefadroxil buy proscar 1mg pills
order estrace 1mg sale order estradiol for sale prazosin sale
how to buy fluconazole buy ampicillin 250mg without prescription cipro 1000mg cheap
buy mebendazole without a prescription order generic vermox 100mg buy tadalafil 10mg for sale
generic avana voltaren 50mg pill buy diclofenac 100mg pills
order cleocin online buy cleocin cheap best ed medication
indocin 50mg canada buy generic suprax suprax where to buy
buy amoxicillin 500mg pills buy clarithromycin pills buy generic clarithromycin over the counter
nolvadex 20mg uk buy cefuroxime order ceftin 500mg sale
order catapres 0.1 mg for sale order spiriva pill buy generic tiotropium bromide 9mcg
sildenafil oral aurogra tablet sildalis oral
brand leflunomide azulfidine tablet order sulfasalazine 500 mg without prescription
isotretinoin 20mg brand amoxicillin 500mg tablet order zithromax without prescription
buy tadalafil 10mg pill cialis 10mg for sale oral cialis
oral azithromycin order gabapentin 100mg sale neurontin 100mg ca
ivermectin 6mg without prescription order stromectol 12mg generic prednisone 10mg tablet
lasix over the counter buy albuterol 4mg pill order albuterol 4mg generic
purchase levitra without prescription where can i buy zanaflex hydroxychloroquine pills
levitra where to buy zanaflex us buy hydroxychloroquine 400mg pills
generic benicar 20mg verapamil 120mg without prescription divalproex pill
purchase carvedilol without prescription aralen pill buy chloroquine 250mg pills
cheap diamox 250mg imdur tablet generic imuran
purchase digoxin purchase digoxin for sale brand molnupiravir 200mg
how to buy naproxen cefdinir 300 mg usa purchase lansoprazole online cheap
order proventil 100 mcg without prescription how to buy phenazopyridine buy pyridium pills
buy generic baricitinib olumiant usa atorvastatin tablet
buy singulair 5mg pills order avlosulfon online cheap cheap dapsone 100 mg
brand nifedipine 10mg perindopril pill buy allegra 180mg