Remove nodes with a given value | Capital One Interview Question