Skip to content

Instantly share code, notes, and snippets.

View mikeliao97's full-sized avatar

Mike Liao mikeliao97

  • Verkada
  • Berkeley, CA
View GitHub Profile
var messageBus = {
//What is the realtionship between subscrib and publish?
subscriberCallbacks: {},
subscribe: function(title, callback) {
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {number} k
class CashAmount {
constructor(amount) {
this.amount = amount;
this.COINS = [ ['hundreds', 100], ['fifties', 50],['twenties', 20], ['tens', 10],
['fives', 5],
['ones', 1],
['quarters', 0.25],
['dimes', 0.10],
['nickels', 0.05],
['pennies', 0.01]
var LinkedList = function(value) {
this.value = value;
this.next = null;
}
//REturns a unique linked list based on the argument
function uniqueLinkedList(link_list) {
var uniqueValues = [];