Skip to content

Instantly share code, notes, and snippets.

@MohaElder
Last active May 4, 2026 00:01
Show Gist options
  • Select an option

  • Save MohaElder/0e728be00ad8632a1d0829cff0ac8481 to your computer and use it in GitHub Desktop.

Select an option

Save MohaElder/0e728be00ad8632a1d0829cff0ac8481 to your computer and use it in GitHub Desktop.
Angelica Challenge Solution
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