Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def waterjugz(big,small):
- bmax = 4
- smax = 3
- goal = 2
- if bmax%smax == 0:
- return("No Solution")
- elif big == goal:
- return("Solution Found")
- elif big < bmax and small != 0:
- return(waterjugz(big + small,0))
- elif small == 0:
- return(waterjugz(big,small+smax))
- else:
- return(waterjugz(0,big-bmax))
- print(waterjugz(0,0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement