7 kyu

Sir , showMe yourID

664 of 1,347gomesalexandre

Description:

There's a new security company in Paris, and they decided to give their employees an algorithm to make first name recognition faster. In the blink of an eye, they can now detect if a string is a first name, no matter if it is a one-word name or an hyphenated name. They're given this documentation with the algorithm:

In France, you'll often find people with hyphenated first names. They're called "prénoms composés". There could be two, or even more words linked to form a new name, quite like jQuery function chaining ;). They're linked using the - symbol, like Marie-Joelle, Jean-Michel, Jean-Mouloud. Thanks to this algorithm, you can now recognize hyphenated names quicker than Flash ! (yeah, their employees know how to use jQuery. Don't ask me why)

Your mission if you accept it, recreate the algorithm. Using the function showMe, which takes a yourID argument, you will check if the given argument is a name or not, by returning true or false.

Note that

  • String will either be a one-word first name, or an hyphenated first name , its words being linked by "-".
  • Words can only start with an uppercase letter, and then lowercase letters (from a to z)

Now is your time to help the guards !

Regular Expressions
Strings
Fundamentals

Stats:

CreatedMay 30, 2016
PublishedJun 6, 2016
Warriors Trained2830
Total Skips56
Total Code Submissions9026
Total Times Completed1347
JavaScript Completions664
Python Completions611
Ruby Completions114
CoffeeScript Completions13
Total Stars40
% of votes with a positive feedback rating89% of 250
Total "Very Satisfied" Votes206
Total "Somewhat Satisfied" Votes33
Total "Not Satisfied" Votes11
Ad
Contributors
  • gomesalexandre Avatar
  • Javatlacati Avatar
  • GiacomoSorbi Avatar
  • donaldsebleung Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad