This file contains hidden or 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
/** | |
* @typedef {(0 | 1)[][]} IslandInput | |
*/ | |
/** | |
* @typedef {Object} Island | |
* @property {string[]} coordinates | |
*/ | |
/** |
This file contains hidden or 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
/** | |
* 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; | |
} |
OlderNewer