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 re | |
| def computePolkadotScore(art): | |
| lines = art.split('\n') | |
| # Find the eyes line: it has both pupils, written as "() ... ()" | |
| eye_line = next(line for line in lines if line.count('()') >= 2) | |
| # Both pupils combined: each "()" is 2 chars, so 4 chars total | |
| pupil_chars = eye_line.count('()') * 2 |