Leetcode 2108 - Find First Palindromic String in the Array

題目

Problem#

給你一個字串陣列 words 回傳第一個是回文的字串,如果沒有的話回傳空字串。

測資限制#

  • $1 \le n, s \le 100$

想法#

雙指標去判斷一個字串是不是回文

AC Code#

  • 時間複雜度: $\mathcal{O}(n)$
  • 空間複雜度: $\mathcal{O}(1)$