Description:
Solution:
In for loop, we have two parts: odd number length & even number length.
In odd number case, we expand our l & r pointers to both sides, and get the number of palindromic.
In even number case, we do same thing, but l & r pointer starts with different location. (i, i+1)
'LeetCode ๐๏ธ > String' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
659. Encode and Decode Strings (0) | 2023.06.22 |
---|---|
5. Longest Palindromic Substring (0) | 2023.06.20 |
125. Valid Palindrome (0) | 2023.06.19 |
20. Valid Parentheses (0) | 2023.06.18 |
49. Group Anagrams (0) | 2023.06.17 |