← Back to challenges

Anna Likes Daniel

JavaScriptHardregexstringsvalidation

Instructions

Anna is a strange girl. She likes certain boys, but not others. You have to figure out why she likes some, and not the others.

Examples

annaLikes("David") ➞ false

annaLikes("Samuel") ➞ true

annaLikes("Gary") ➞ false

Notes

  • All names / inputs are valid.
  • Anna likes her own name.
  • Check the Tests tab for all 100 examples.
  • Try to solve this one using RegEx.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.