word wrap greedy approach