Last active
May 4, 2026 00:01
-
-
Save MohaElder/0e728be00ad8632a1d0829cff0ac8481 to your computer and use it in GitHub Desktop.
Angelica Challenge Solution
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
| def computePolkadotScore(art): | |
| lines = art.split('\n') | |
| for line in lines: | |
| i = line.find('""""') | |
| if i != -1: | |
| lo, hi = i, i + 3 | |
| break | |
| pupils = 0 | |
| for line in lines: | |
| if '• ; •' in line: | |
| pupils = sum(len(c.encode('utf-8')) for c in line if c == '•') | |
| break | |
| inside = sum(1 for line in lines for x, ch in enumerate(line) | |
| if ch == 'O' and lo <= x <= hi) | |
| outside = sum(1 for line in lines for x, ch in enumerate(line) | |
| if ch == 'O') - inside | |
| return outside + inside * pupils |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment