Skip to content

Instantly share code, notes, and snippets.

View naufaldi's full-sized avatar
🏘️
Remote Worker

Naufaldi naufaldi

🏘️
Remote Worker
View GitHub Profile
@naufaldi
naufaldi / diagonal-difference.js
Created July 8, 2019 02:59 — forked from lasverg/diagonal-difference.js
Diagonal Difference | Solution | JavaScript
/*
Diagonal Difference Solution.
sample matrix = [[1,2,3], [4,5,6], [7,8,9]]
*/
function diagonalDifference(arr) {
// length of input array.
const length = arr.length;
let diagonal1 = 0,
diagonal2 = 0;
// Looping through the array and summing the diagonals.
@naufaldi
naufaldi / webpack.config.js
Created July 4, 2019 01:50 — forked from danielwrobert/webpack.config.js
Example Webpack Config File
const path = require( 'path' );
const webpack = require( 'webpack' );
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = ( env, options ) => {
return {
entry: './src/block.js',
output: {
path: path.resolve( __dirname, 'build' ),