Dynamic Programming and LinkedList problems solved