Recusive and list based solutions