Add #112 solutions in C, Python, and Ruby