Post History
Scala, 25 bytes a=>_.flatMap(a map _.min) Try it in Scastie! Pretty trivial solution, but here's a bad explanation anyway: //a is the first string a =>_.flatMap(a map _.min) //b is th...
Answer
#2: Post edited
- # Scala, 25 bytes
- ```
- a=>_.flatMap(a map _.min)
- ```
- [Try it in Scastie!](https://scastie.scala-lang.org/f39MzvQSRR2zgfJA9qZmNg)
Pretty trivial solution.
- # Scala, 25 bytes
- ```
- a=>_.flatMap(a map _.min)
- ```
- [Try it in Scastie!](https://scastie.scala-lang.org/f39MzvQSRR2zgfJA9qZmNg)
- Pretty trivial solution, but here's a bad explanation anyway:
- ```
- //a is the first string
- a =>_.flatMap(a map _.min)
- //b is the second string, x is each char in b
- a => b => b.flatMap(x => a map x.min)
- //For every char y in a, min(x, y) is chosen
- a => b => b.flatMap(x => a.map(y => x.min(y))
- //The results are concatenated because flatMap is used
- ```