Skip to content

Instantly share code, notes, and snippets.

View ayastreb's full-sized avatar

Anatoliy Yastreb ayastreb

View GitHub Profile
function numOfPathsToDest(n) {
if (n === 1) return 1;
let lastRow = new Array(n).fill(1);
let currentRow = [];
for (let row = 1; row < n; row++) {
for (let col = row; col < n; col++) {
const lastCol = col > row ? currentRow[col - 1] : 0;
currentRow[col] = lastRow[col] + lastCol;
}
@ayastreb
ayastreb / webpack.config.js
Created May 25, 2017 04:20
Build Chrome Extension with React using Webpack
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
// Entry files for our popup and background pages
entry: {
popup: './src/popup.js',