suffix array naive algorithm
0-a knapsack recursion
0-1 knapsack dp