Skip to content

Instantly share code, notes, and snippets.

View dmaldonado8's full-sized avatar
🏠
Working from home

David Maldonado dmaldonado8

🏠
Working from home
View GitHub Profile
@dmaldonado8
dmaldonado8 / solucion_1.py
Created May 18, 2025 16:08
Torre de hanoi
A = [4, 3, 2, 1] # Torre origen
B = [] # Torre destino
C = [] # Torre auxiliar
def mover(origen, destino):
if not origen:
origen.append(destino.pop())
elif not destino:
destino.append(origen.pop())
elif origen[-1] < destino[-1]: