Leetcode 3412. Find Mirror Score of a String
Scan the string left-to-right and greedily pair each character with the nearest earlier unmarked index whose character is its alphabet mirror (a↔z, b↔y, ...), marking both and adding their index difference to the total; return the final score. The core challenge is efficiently tracking nearest unmarked previous occurrences (n ≤ 1e5), typically using per-letter stacks or similar.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.