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
import json | |
import urllib3 | |
from datetime import datetime, date | |
from time import struct_time, mktime | |
import decimal | |
from boto3.dynamodb.types import TypeDeserializer | |
URL = "<ES-ENDPOINT>/posts/_doc/{0}" | |
headers = {'Content-Type': 'application/json'} |
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
def dp_min_coins(target, coins, cache): | |
# base case | |
min_coins = target | |
if target in coins: | |
cache[target] = 1 | |
return 1 | |
elif cache[target] > 0: | |
return cache[target] |