Task:
Write a function that takes a list of strings and returns the number of smileys in that list.
What counts as a smiley:
🟢A smiley must have eyes. Two options:
: and ;🟢A smiley may have a nose (or not). Noses:
- and ~🟢A smiley must be smiling (sad ones are not accepted!). Smiles:
) and D🟢If the string contains anything else, it is not a smiley.
Test examples:
[':)', ';(', ';}', ':-D'] # -> 2
[';D', ':-(', ':-)', ';~)'] # -> 3
[';]', ':[', ';*', ':$', ';-D'] # -> 1Post your solutions in the comments 👇
#algosobes
Comentarios
0Aún no hay comentarios.
Inicia sesión para participar en la conversación.