You will be given:
- an amount of money
- an array of coin denominations
- you have access to an unlimited number of each coin denomination
For example, there are 3 ways to give change for 4 if you have coins with denomination 1 and 2:
1+1+1+1
const dir = { | |
North: { x: 0, y: 1, R: "East", L: "West" }, | |
West: { x: -1, y: 0, R: "North", L: "South" }, | |
South: { x: 0, y: -1, R: "West", L: "East" }, | |
East: { x: 1, y: 0, R: "South", L: "North" } | |
}; | |
const moves = { | |
R: ([x, y, d]) => ([x, y, dir[d].R]), | |
L: ([x, y, d]) => ([x, y, dir[d].L]), |
var express = require('express'); | |
var passport = require('passport'); | |
var GoogleStrategy = require('passport-google-oauth20').Strategy; | |
var BearerStrategy = require('passport-http-bearer').Strategy; | |
var app = express(); | |
app.use('/', express.static('build')); | |
passport.use(new GoogleStrategy({ |
var swatch = document.createElement('div'); | |
swatch.style.width = 500; | |
swatch.style.height = 500; | |
document.body.appendChild(swatch); | |
function turnRed() { | |
swatch.style.backgroundColor = 'red'; | |
requestAnimationFrame(turnBlue); | |
} |
Start with any positive integer n. Then each term is obtained from the previous term as follows:
Numbers form a tree as they work their way down to 1, as seen in the image below. For example, starting with the number 5 you next get 16 ( 3x5 + 1 ) and then 8 ( 16 / 2 ). Starting with the number 64, you get 32 ( 64 / 2 ) and then 32. So the numbers 5 and 64 converge at 16.
#!/usr/bin/env python3 | |
# first author: Edoardo Paolo Scalafiotti <[email protected]> | |
# Edits done by: Marco Bosch <[email protected]> | |
import os | |
from time import sleep | |
import signal | |
import sys | |
import RPi.GPIO as GPIO |
{ | |
"ignition": { | |
"version": "2.2.0" | |
}, | |
"networkd": { | |
"units": [ | |
{ | |
"name": "00-enp.network", | |
"contents": "[Match]\nName=enp*\n\n[Network]\nDHCP=yes" | |
} |