Solution for weekly contest 9

Status: Unsolved

Signed-off-by: Ajeet Jha <ajeetjha1@gmail.com>