We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da32e17 commit 824d1a0Copy full SHA for 824d1a0
palindromic-substrings/hu6r1s.py
@@ -1,12 +1,13 @@
1
class Solution:
2
"""
3
-
+ 브루트포스로 모두 탐색하면서 집어넣는 방법
4
+ O(n^2)
5
- def countSubstrings(self, s: str) -> int:
6
- cnt = []
7
- for i in range(len(s)):
8
- for j in range(i, len(s)):
9
- sub = s[i:j+1]
10
- if sub and sub == sub[::-1]:
11
- cnt.append(sub)
12
- return len(cnt)
+ def countSubstrings(self, s: str) -> int:
+ cnt = []
+ for i in range(len(s)):
+ for j in range(i, len(s)):
+ sub = s[i:j+1]
+ if sub and sub == sub[::-1]:
+ cnt.append(sub)
13
+ return len(cnt)
0 commit comments