Skip to content

Instantly share code, notes, and snippets.

View Kush1601's full-sized avatar

Kush Dudhia Kush1601

  • Washington D.C, USA
  • 03:52 (UTC -04:00)
View GitHub Profile
// Avantos Coding Challenge: computePolkadotScore
// Formula:
// score = polkadotsOutsideLips + (polkadotsInsideLips * pupilCharCount)
function computePolkadotScore(asciiArt) {
const lines = asciiArt.split('\n');
// Lips: second occurrence of 6+ tildes (the first ~~~~~~ is the forehead, the second is the mouth)
const tildeRanges = [];
for (const line of lines) {