The key observation: palindrome strings of even lengths have all letters even occurrences, palindrome strings of odd lengths have all letters even occurrences but except one letter with odd occurrence.
C++Python Greedy DP速解Leetcode 1014 Best Sightseeing Pair算是貪婪演算還是動態規劃,其實都算解法類似Kadane演算法。
-----------
Leetcode 1014. Best Sightseeing Pair is considered greedy algorithm or dynamic programming, but it is actually both. It's similar to Kadane's Algorithm