solve 2 string questions using hashtable