7 kyu

How much coffee do you need?

674 of 1,559nbeck

Description:

Everybody know that you passed to much time awake during night time...

Your task here is to define how much coffee you need to stay awake after your night. You will have to complete a function that take an array of events in arguments, according to this list you will return the number of coffee you need to stay awake during day time. Note: If the count exceed 3 please return 'You need extra sleep'.

The list of events can contain the following:

  • You come here, to solve some kata ('cw').

  • You have a dog or a cat that just decide to wake up too early ('dog' | 'cat').

  • You just watch a movie ('movie').

  • Other events can be present and it will be represent by arbitrary string, just ignore this one.

Each event can be downcase/lowercase, or uppercase. If it is downcase/lowercase you need 1 coffee by events and if it is uppercase you need 2 coffees.

Arrays
Regular Expressions
Fundamentals

Similar Kata:

Stats:

CreatedSep 18, 2016
PublishedSep 18, 2016
Warriors Trained2772
Total Skips58
Total Code Submissions6805
Total Times Completed1559
Ruby Completions125
JavaScript Completions809
Python Completions674
Crystal Completions11
CoffeeScript Completions12
Total Stars40
% of votes with a positive feedback rating89% of 344
Total "Very Satisfied" Votes282
Total "Somewhat Satisfied" Votes47
Total "Not Satisfied" Votes15
Total Rank Assessments12
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • nbeck Avatar
  • myjinxin2015 Avatar
  • tachyonlabs Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad