Skip to main content
Ctrl+K
tryalgo 1.5.0 documentation - Home tryalgo 1.5.0 documentation - Home
  • Installation
  • Quick start
  • Content of the library
  • Gallery of examples
  • tryalgo
  • Installation
  • Quick start
  • Content of the library
  • Gallery of examples
  • tryalgo

Section Navigation

  • Countdown
  • Coin change
  • Gallery of examples
  • Coin change

Note

Go to the end to download the full example code.

Coin change#

from tryalgo import coin_change

print(coin_change([3, 5, 11], 29))  # True because 29 = 6 x 3 + 0 x 5 + 1 x 11

An explanation of this code is given (in French) on our blog tryalgo.org by Clémence Réda:

  • Rendu de monnaie, bases de programmation dynamique

Download Jupyter notebook: coin_change.ipynb

Download Python source code: coin_change.py

Download zipped: coin_change.zip

Gallery generated by Sphinx-Gallery

previous

Countdown

next

tryalgo

© Copyright 2016-2023, Christoph Dürr and Jill-Jênn Vie.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.2dev0.