Add solutions to related 116 and 117.