6 kyu
Who likes it?
132,182 of 367,176BattleRattle
Description:
You probably know the "like" system from Facebook and other pages. People can "like" blog posts, pictures or other items. We want to create the text that should be displayed next to such an item.
Implement the function which takes an array containing the names of people that like an item. It must return the display text as shown in the examples:
[] --> "no one likes this"
["Peter"] --> "Peter likes this"
["Jacob", "Alex"] --> "Jacob and Alex like this"
["Max", "John", "Mark"] --> "Max, John and Mark like this"
["Alex", "Jacob", "Mark", "Max"] --> "Alex, Jacob and 2 others like this"
Note: For 4 or more names, the number in "and 2 others"
simply increases.
Strings
Fundamentals
Similar Kata:
Stats:
Created | Oct 22, 2013 |
Published | Oct 22, 2013 |
Warriors Trained | 651055 |
Total Skips | 59166 |
Total Code Submissions | 1044794 |
Total Times Completed | 367176 |
JavaScript Completions | 141561 |
Haskell Completions | 3203 |
Ruby Completions | 9033 |
Python Completions | 132182 |
C# Completions | 22615 |
C++ Completions | 14346 |
Java Completions | 31426 |
PHP Completions | 6883 |
C Completions | 2774 |
Julia Completions | 163 |
Prolog Completions | 37 |
Rust Completions | 2973 |
F# Completions | 130 |
TypeScript Completions | 6352 |
COBOL Completions | 19 |
Factor Completions | 19 |
Scala Completions | 287 |
CoffeeScript Completions | 13 |
Dart Completions | 230 |
Total Stars | 5410 |
% of votes with a positive feedback rating | 86% of 28650 |
Total "Very Satisfied" Votes | 21663 |
Total "Somewhat Satisfied" Votes | 6155 |
Total "Not Satisfied" Votes | 832 |