Amazon Interview Question

dp and graph and tree and string