This file contains 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
/** | |
* Generates Pascal's triangle | |
* @param {number} numRows | |
* @return {number[][]} Pascal's Priangle | |
*/ | |
var generate = function(numRows) { | |
var pascalsTriangle = []; | |
//initial value at top of triangle | |
if (numRows >= 1) { |
This file contains 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
var Tree = function(value) { | |
this.value = value; | |
this.children = []; | |
} | |
Tree.prototype.addChild = function(value) { | |
this.children.push(new Tree(value)); | |
} | |
/** |
This file contains 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
const hasPathToSum = function(node, targetSum) { | |
var sum = 0; | |
while(sum !== targetSum) { | |
if (!node) { | |
break; | |
} | |
sum += node.datum; |
This file contains 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
GET http://localhost:3000/business/--9e1ONYQuAa-CB_Rrw7Tw | |
Sample Output: | |
{ | |
"id": "--9e1ONYQuAa-CB_Rrw7Tw", | |
"name": "Delmonico Steakhouse", | |
"neighborhood": "The Strip", | |
"address": "3355 Las Vegas Blvd S", | |
"city": "Las Vegas", |
This file contains 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 React from 'react'; | |
import { shallowToJson } from 'enzyme-to-json'; | |
import { CarouselImage } from './../../client/src/components/CarouselImage.jsx'; | |
describe('<CarouselImage/>', () => { | |
let component = shallow(<CarouselImage/>); | |
it('should render', () => { | |
expect(shallowToJson(component)).toMatchSnapshot(); |
This file contains 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
FROM node:latest | |
LABEL maintainer Bryan Manuele <[email protected]> | |
RUN mkdir -p /src/app | |
WORKDIR /src/app | |
COPY . /src/app |
This file contains 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
/** | |
* Definition for a binary tree node. | |
* function TreeNode(val) { | |
* this.val = val; | |
* this.left = this.right = null; | |
* } | |
*/ | |
/** | |
* @param {TreeNode} root | |
* @param {number} k |
This file contains 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
Cash Register API | |
database: | |
Items Table: | |
* id INT (index) | |
* price MONEY | |
* name STRING (natural language index) | |
* SKU INT | |
* PPU MONEY | |
* Taxable BOOL |
This file contains 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
<link rel="canonical"> |
This file contains 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
class TicTacToe { | |
constructor() { | |
this.board = [ | |
['-', '-', '-'], | |
['-', '-', '-'], | |
['-', '-', '-'], | |
]; | |
this.currentPlayer = 'x'; |
OlderNewer