C++ Py3計數解Leetcode 2131 Longest Palindrome by Concatenating Two Letter Words
回文問題常被問到。這題基本上可以用計數的方法來解決。重點是兩個字母的字串 xy 和 yx 可以配對。
-----
Palindrome question is quite often asked. This question can be solved basically by using counting. It's important to know the 2-letter strings xy & yx can be paired.
[codes on Leetcode]https://leetcode.com/problems/longest-palindrome-by-concatenating-two-letter-words/solutions/6778069/2d-array-counter-freq-count-c-c-py3-beats-100/
[C, C++ ,python速解迴文Leetcode 2108 Find First Palindromic String in the Array]https://www.youtube.com/watch?v=eXhdv8jDpao
沒有留言:
張貼留言