Word search solver in C