Add #27 solutions in C and Python