2024-04-22
This was the final problem in an Alibaba online assessment on April 21st. The intended solution was state-compressed DP → fast exponentiation. Unfortunately, I made an error in the fast exponentiation implementation, causing one-third of the test cases to fail due to TLE. Here’s a post-mortem analysis.
Problem: A string consists of lowercase letters. Its weight is defined as the number of non-adjacent vowel pairs (vowels: a, e, i, o, u).
read more