Skip to content

Instantly share code, notes, and snippets.

View ivoryblakk's full-sized avatar
💻
For Hire

George Ingram ivoryblakk

💻
For Hire
View GitHub Profile
function maxProfitWithKTransactions(prices, k) {
let maxProfit = [];
let boughtPrice = null;
let buy = []; // total of buys
let sell = []; // total of sells
let profitableTrades = [];
let transLimit = null // will be handled by .5 increments
let holdStock = false;
//EDGE CASES
@ivoryblakk
ivoryblakk / gist-reveal.it-slides.html
Created December 15, 2017 12:51 — forked from ryanj/gist-reveal.it-slides.html
Gist-powered Revealjs slideshow presentations http://gist-reveal.it
<section data-background-transition='zoom' data-transition='concave' data-background='http://ryanjarvinen.com/presentations/shared/img/broadcast_reveal_dark.png' data-state='blackout'>
<h2>Gist-Powered</h2>
<h1>Reveal.js</h1>
<h2>Slideshow Presentations</h2>
<br/>
<h1 class='fragment grow'><a style='color:deepskyblue;' href='http://gist-reveal.it'>gist-reveal.it</a></h1>
</section>
<section data-background-transition='zoom' data-transition='linear' id='try-it'>
<h2>Try it out!</h2>
<p>Create your own deck by forking a copy of <a href='https://gist.github.com/ryanj/af84d40e58c5c2a908dd'>this github gist</a>: <br /><a href='https://gist.github.com/ryanj/af84d40e58c5c2a908dd'>https://gist.github.com/ryanj/af84d40e58c5c2a908dd</a></p>
Beer = [
{type: 'wheat', area: {city: 'Berlin', country: 'Germany'}, hop: 3 },
{type: 'pilsner', area: {city: 'venice', country: 'Italy'}, hop: 1 },
{type: 'IPA', area: {city: 'Berlin', country: 'Germany'}, hop: 5 }
]
@ivoryblakk
ivoryblakk / prob16
Created September 14, 2017 16:17
ughhh
/*
Write a function modifyObject that takes 3 arguments and returns a new object.
Arguments:
1) An object that we would like to add to
2) An object that dictates what needs to be added
3) A boolean value that specifies whether the values of object1 should be modified or not.
If true, the values of object1 should be overwritten by the values of object2
If false, the values of object1 cannot be modified.