This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution(object): | |
| def coinChange(self, coins, amount, results=[0]*(10000)): | |
| """ | |
| :type coins: List[int] | |
| :type amount: int | |
| :rtype: int | |
| :type | |
| """ | |
| minCoins = amount | |
| if amount in coins: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python Linear Programming | |
| c = [5, 10] | |
| A = [[-1,-1], [1,1]] | |
| b = [-15, 25] | |
| x0_bounds = (5, None) | |
| x1_bounds = (7, None) | |
| from scipy.optimize import linprog | |
| res = linprog(c, A_ub = A, b_ub=b, bounds=(x0_bounds, x1_bounds),method="simplex",options={"disp":True}) | |
| print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: mit |