Sir , showMe yourID
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 !
Stats:
Created | May 30, 2016 |
Published | Jun 6, 2016 |
Warriors Trained | 2830 |
Total Skips | 56 |
Total Code Submissions | 9026 |
Total Times Completed | 1347 |
JavaScript Completions | 664 |
Python Completions | 611 |
Ruby Completions | 114 |
CoffeeScript Completions | 13 |
Total Stars | 40 |
% of votes with a positive feedback rating | 89% of 250 |
Total "Very Satisfied" Votes | 206 |
Total "Somewhat Satisfied" Votes | 33 |
Total "Not Satisfied" Votes | 11 |