Skip to content

Instantly share code, notes, and snippets.

View BenDMyers's full-sized avatar
🦖

Ben Myers BenDMyers

🦖
View GitHub Profile
@BenDMyers
BenDMyers / largest-island.js
Created March 25, 2024 15:05
[RWC] Largest Island 🏝️
/**
* @typedef {(0 | 1)[][]} IslandInput
*/
/**
* @typedef {Object} Island
* @property {string[]} coordinates
*/
/**
@BenDMyers
BenDMyers / unique-substring.js
Last active April 15, 2024 14:04
[RWC] uniqueSubstr
/**
* Sorter function for sorting an array of strings by their length, in descending order
* @param {string} a
* @param {string} b
* @returns positive/negative number representing relative comparison of the two elements
*/
function byLength(a, b) {
return b.length - a.length;
}