Created
May 1, 2026 19:47
-
-
Save fkvivid/541261dd0d963c3e850bcac0db7d3cb8 to your computer and use it in GitHub Desktop.
Solution of polkadot score
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
| , ,-', | |
| ,', ,' ',' ,' ÅÑGË£ÏÇÄ †(–)Ë ßRĆ | |
| '-', ' ,' | |
| ' -, ', | |
| ' -, ', , - - -, | |
| ('''''' ®'''''''') ,,,,, ,-' -,''''''''', | |
| ` ~„''`„~ ' ', ,', -' , -,'' ''''''''', | |
| "„ " - „ „ - ",®,-' `~~' ''''''' | |
| „" " „ „ - " ,',,,', | |
| „-" " " " " " " ~~~~~~" - „ ,' | |
| „" –,'' ~ , • ; • " "„ | |
| """"; ' - , , ; , , , - '' ' ' -,_ ', ', | |
| , -' ' ', ,' ,' ',~', ', | |
| ,' ' - , ,()' /\ ', (),'¯ ,' `¸`; | |
| ', ` ` ` ` ` ` ,-,,,-' | |
| '-, ,¬ ,-' | |
| ' -, ~ ~~~~~~' ' ` ,-' | |
| `~-,,,,,,, ,,,,,,,,,,-~' | |
| ('('('(,,, ; ; •Å(V)åö• | |
| '-, '-,''' ,-';`,`'ˆˆˆˆˆ ,' ;' ' -, •97• | |
| ;¯ ; ; ; ', ; ; ,' ; ‚¸ ' -, ••• | |
| ; ; ; ''''''''''' ``'-,', ,' | |
| ; ;, -¬; O O O O '-',,,,,,,,,,,, | |
| ; ; O O O O O ,' O ,' | |
| ' - - ' `; O O O O O ,' | |
| ,-' O O O O O O ,' | |
| ,-' O O O O O O ,' | |
| ,-' O O O O O O ,' | |
| ,-' O O O O O O O O O,-'-, | |
| ``¬ -,,,,,,,-¬~,~~~~~~~~~--',) (' -, | |
| ', (', ' -, '-, | |
| ',) (', `-,) ' -, | |
| ', ', `-, ,',-----, | |
| ',) ; `\,- ---' | |
| ¸,,,,'‡ (; | |
| (¸,,,,,';_'\ ßy §(V)òó†(–)775 ™ |
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
| import { readFileSync } from "fs"; | |
| function computePolkadotScore(string) { | |
| const angelica = string.split("\n"); | |
| const lips = " ' -, ~ ~~~~~~' ' ` ,-'"; | |
| let lipsStartIndex = 0; | |
| let lipsEndIndex = 0; | |
| for (let i = 0; i < lips.length; i++) { | |
| if (lips.slice(i, i + 6) === "~~~~~~") { | |
| lipsStartIndex = i; | |
| lipsEndIndex = i + 5; | |
| break; | |
| } | |
| } | |
| let polkaotsOutsideLips = 0; | |
| let polkaotsInsideLips = 0; | |
| let totalPupils = 0; | |
| for (let i = 0; i < angelica.length; i++) { | |
| for (let j = 0; j < angelica[i].length; j++) { | |
| if (angelica[i][j] === "•") { | |
| totalPupils++; | |
| } | |
| if ((angelica[i][j] === "•") && (j >= lipsStartIndex && j <= lipsEndIndex)) { | |
| polkaotsInsideLips++; | |
| } else if ((angelica[i][j] === "•") && (j < lipsStartIndex || j > lipsEndIndex)) { | |
| polkaotsOutsideLips++; | |
| } | |
| } | |
| } | |
| return polkaotsOutsideLips + (polkaotsInsideLips * totalPupils); | |
| } | |
| const string = readFileSync("Angelica.txt", "utf8"); | |
| console.log(computePolkadotScore(string)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment