Smile Counter Medium

+100 PTS

Before you start the test, check out our tutorial challenge

  • TYPE CODE PRACTICE CHALLENGE
  • LANGUAGES BASH, C, C++, C# AND 21 MORE
    LANGUAGES BASH, C, C++, C#, CLOJURE, ELIXIR, ERLANG, GO, GROOVY, HASKELL, JAVA, JAVASCRIPT, JULIA, KOTLIN, NIM, PERL, PHP, PYTHON2, PYTHON, RUBY, RUST, SCALA, SWIFT, TYPESCRIPT, VB
  • TIME ~25MIN

Smile Counter

Challenge outline

Hello and welcome to the challenge!


The management of the customer service department has introduced a new way to reward employees. Employees will receive bonuses based on the number of smiles they have received in e-mails from customers. You are given the task of writing an application supporting a new reward strategy.


Write a code which will count all smiles in the given string. Every smile consists of:

  • eyes - : or ;
  • mouth - D or )
  • opionally nose - ~ or -


Examples

  • valid smiles: :) :-) :D ;~)
  • invalid smiles: ;( ;-| :> :3


You can solve this programming contest in Java, JavaScript, Python, C++ and many more languages. If you want, you can also take part in other April 2019 competitions. Below you can find some of them:



Have fun and good luck! :)


Did you like this challenge and would like to try your hand at some interesting big programming competitions? Check what’s all over the news in tech world in April 2019 in our article with upcoming IT Conferences, Hackathons and Online Challenges.