Add #18 C solution