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

Stats:

CreatedOct 22, 2013
PublishedOct 22, 2013
Warriors Trained651055
Total Skips59166
Total Code Submissions1044794
Total Times Completed367176
JavaScript Completions141561
Haskell Completions3203
Ruby Completions9033
Python Completions132182
C# Completions22615
C++ Completions14346
Java Completions31426
PHP Completions6883
C Completions2774
Julia Completions163
Prolog Completions37
Rust Completions2973
F# Completions130
TypeScript Completions6352
COBOL Completions19
Factor Completions19
Scala Completions287
CoffeeScript Completions13
Dart Completions230
Total Stars5410
% of votes with a positive feedback rating86% of 28650
Total "Very Satisfied" Votes21663
Total "Somewhat Satisfied" Votes6155
Total "Not Satisfied" Votes832
Ad
Contributors
  • BattleRattle Avatar
  • jhoffner Avatar
  • xcthulhu Avatar
  • Xaositect Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • natan Avatar
  • anter69 Avatar
  • myjinxin2015 Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • B1ts Avatar
  • tfrommen Avatar
  • Blind4Basics Avatar
  • acjoker Avatar
  • Voile Avatar
  • jaro2gw Avatar
  • Cyhan Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • clcraig Avatar
  • monadius Avatar
  • Awesome A.D. Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • ZBrachinara Avatar
  • trashy_incel Avatar
  • username0 Avatar
  • user8436785 Avatar
  • Luvexina Avatar
  • akar-0 Avatar
  • tri@ Avatar
  • dfhwze Avatar
  • jeydo6 Avatar
  • LearningFTW Avatar
  • KayleighWasTaken Avatar
Ad