I question the validity of this challenge. No Oxford comma??? 🧐
But on with it...
defmoduleLikeddodefby([]),do:"no one likes this"defby([friend]),do:"#{friend} likes this"defby([friend_1,friend_2]),do:"#{friend_1} and #{friend_2} like this"defby([f1,f2,f3]),do:"#{f1}, #{f2} and #{f3} like this"defby([friend_1,friend_2|friends]),do:"#{friend_1}, #{friend_2} and #{length(friends)} others like this"endLiked.by([])# "no one likes this"Liked.by(["the strippers"])# "the strippers like this"Liked.by(["the strippers","JFK"])#"the strippers and JFK like this"Liked.by(["the strippers","JFK","Stalin"])# "the strippers, JFK and Stalin like thisamerica=List.duplicate("american",300000000)# p expensive, don't actually make this large of a listLiked.by(["the strippers","JFK","Stalin"|america])# "the strippers, JFK and 300000001 others like this"
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I question the validity of this challenge. No Oxford comma??? 🧐
But on with it...