I'm starting with Scala and now I am talking about higher order functions but I am having a hard time dealing with this way of programming using functions as inputs.
I must code a higher order function using only fold, scan and/or reduce that concatenates a string like so:
concatenate(List("S", "T", "R", " example!") , f) //> res1: List[String] = List(STR example!, TR example!, R example!, " example!", "") Does anyone know how can I approach this problem?