Solution for coding dojo challenges