Amazon Interview Question

2nd question was on linkedlist