Counting sort with a twist

Given [21, 41, 17, 45, 9, 28], the maximum difference is 13.

Straightforward Algorithm

const maxGap = input =>
input
.sort((a, b) => a — b)
.reduce((acc, cur, idx, src) =>
Math.max(acc, idx > 0 ? …

An Intro to the Node.js Client Library for Compute Engine

List of Lovely Tech Blogs

Amy Nguyen

Erica Sadun

Franziska Hinkelmann

Senior Engineer at Google. Node.js Monkey Patcher.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store