Shortest Code : Reading a Book
Description:
Shortest Code : Reading a Book
(Code length limit: 130 chars)
This is the challenge version of coding 3min series. If you feel difficult, please complete the simple version
Task
John reading a book, When he met a word that he had never read, he will read the word spelling, each letter(not for punctuation,number, only letter) takes 1 second; If he have read the word, he will read the word, each word takes 1 second.
Give you a parameter words
(Each word is separated by space)
Return a number that how many seconds John can finish reading.
Example
sc("Hello World!")=10
John read all the word spelling.
sc("black cat and white cat all are cat")=24
John read the 2nd 'cat' and 3rd 'cat' used 2 seconds.
sc("black Cat and white cat all are cat")=24
'Cat' and 'cat' are same words,your code should ignore the case
words1="Related Articles: Ruby Environment, CoffeeScript Environment, JavaScript Environment, Python Environment, Haskell Environment, Java Environment, Clojure Environment, .NET Environment."
sc(words1)=86
words2="Related Articles: Ruby Environment, Coffee Script Environment, Java Script Environment, Python Environment, Haskell Environment, Java Environment, Clojure Environment, .NET Environment."
sc(words2)=78
CoffeeScript is one word, Coffee Script are two words
Code length calculation
In javascript, we can't get the user's real code, we can only get the system compiled code. Code length calculation is based the compiled code.
For example:
If you typed sc=x=>x+1
after compile, it will be:sc=function(x){return x+1;}
Series
- Bug in Apple
- Father and Son
- Jumping Dutch act
- Planting Trees
- Reading a Book
- Eat watermelon
- Special factor
- Symmetric Sort
- Are they symmetrical?
- Guess the Hat
- Find the murderer
- Give me the equation
- Balance Attraction
- Max Value
- Regular expression compression
- Remove screws I
- Remove screws II
- Collatz Array(Split or merge)
- Trypophobia
- Virus in Apple
- Waiting for a Bus
- Tidy up the room
Similar Kata:
Stats:
Created | Apr 12, 2016 |
Published | Apr 12, 2016 |
Warriors Trained | 376 |
Total Skips | 14 |
Total Code Submissions | 1898 |
Total Times Completed | 139 |
JavaScript Completions | 139 |
Total Stars | 10 |
% of votes with a positive feedback rating | 93% of 68 |
Total "Very Satisfied" Votes | 60 |
Total "Somewhat Satisfied" Votes | 7 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 5 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 6 kyu |