6 kyu

Extract last names of people named Michael

Description:

Given a text, for example:

const inputText = "Michael, how are you? - Cool, how is John Williamns and Michael Jordan? I don't know but Michael Johnson is fine. Michael do you still score points with LeBron James, Michael Green AKA Star and Michael Wood?";

get an array of last names of people named Michael. The result should be:
["Jordan", "Johnson", "Green", "Wood"]

Notes:

  • First name will always be Michael with upper case 'M'.
  • There will always be a space character between 'Michael' and last name.
  • Last name will always be one word, starting with an upper-case letter and continuing with lower-case letters.
  • There will always be at least one 'Micheal' with a valid last name in the input text.
Regular Expressions
Algorithms
Data Structures
Arrays

Stats:

CreatedOct 19, 2016
PublishedOct 19, 2016
Warriors Trained1841
Total Skips50
Total Code Submissions3032
Total Times Completed959
JavaScript Completions959
Total Stars57
% of votes with a positive feedback rating94% of 221
Total "Very Satisfied" Votes195
Total "Somewhat Satisfied" Votes26
Total "Not Satisfied" Votes0
Total Rank Assessments9
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • PiotrBerebecki Avatar
  • user5036852 Avatar
Ad