verifies whether or not a third string is a merge of two strings using
dynamic programming