Skip to content

Instantly share code, notes, and snippets.

//https://old.reddit.com/r/dailyprogrammer/comments/o4uyzl/20210621_challenge_395_easy_nonogram_row/
class Nonogram {
fun nonogramrow(binaryArray: List<Int>): List<Int> {
var currentLength = 0
var building = false
val result = mutableListOf<Int>()
for (elem in binaryArray) {
if (elem == 1) {
currentLength++
building = true
//https://old.reddit.com/r/dailyprogrammer/comments/nucsik/20210607_challenge_393_easy_making_change/
class MakingChange {
fun change(amount: Int): Int {
var currentAmount = amount
var coinCount = 0
val possibleCoins = listOf(1, 5, 10, 25, 100, 500).sorted().reversed()
for (coin in possibleCoins) {
while (coin <= currentAmount) {
coinCount++
currentAmount -= coin
@johnblanco
johnblanco / script.rb
Created February 19, 2016 15:47
Script que alerta sobre el precio del bitcoin
require 'json'
require 'net/http'
ALERT_PRICE = 419
uri = URI('https://api.bitcoinaverage.com/exchanges/USD')
response = Net::HTTP.get(uri)
h = JSON.parse(response)
price = h['bitfinex']['rates']['last']