Leetcode: Word Break II

Approach 1: Build a tree