LeetCode Solution, Easy, 290. Word Pattern