これも問17でも使った、spiltAtとmatchを使って解くと解ける問題
spiltAtを使ってからmatchを使うとpreとpostに分割されている。 そこで、
case (pre, post) =>
と、書きます。