Add #30 solutions in C, Python, and Ruby