Merkle Interview Question

Asked to do list manipulation using python