1class Solution:
2 def solve(self, s):
3 x = ""
4 for i in s:
5 if i >= 'a' and i <= 'z':
6 x += i
7 i, j = 0, len(x) - 1
8 while i <= j:
9 if x[i] != x[j]:
10 return False
11 i += 1
12 j -= 1
13 return True
1def StringPeriods (s):
2
3for i in range (int (len (s)/2), 0,-1):
4
5a = s[i] count = 2
6
7b = "
8
9while len (b)
10
11b = a * count
12
13if b == s:
14
15return a
16
17len(s):
18
19count += 1
20
21return -1
1n = 0
2while n <= 0:
3 n = int(input("Enter the number of lines: "))
4for i in range(1, n+1):
5 print('*' * i)
1if g == 0:
2 return [1] * len(originCities)
3 if g >= n:
4 return [0] * len(originCities)
5 components = {i: i for i in range(g + 1, n + 1)}
6 for candidate in range(g + 1, n + 1):
7 current = [t * candidate for t in range(1, n // candidate + 1)]
8 current_components = [components[e] for e in current]
9 minone = min(current_components)
10 for curr in current:
11 components[curr] = minone
12 res = []
13 for k in range(len(originCities)):
14 origin, destination = originCities[k], destinationCities[k]
15 if origin > g and destination > g and components[origin] == components[destination]:
16 res.append(1)
17 else:
18 res.append(0)
19 return res
1class solition {
2 solve(s) {
3 let x="";
4 for (i in s)
5 if (i>='a' || i<='z'){
6 x+=i
7 i,j=0; x.length=-1;
8 }
9 for(i<=j){
10 if (x[i]!=x[j]){
11 return false
12 }
13 else (j+=1 j-=1){
14 return true
15 }
16 }
17 }
18}
1n = 0
2while n <= 0:
3 n = int(input("Enter the number of lines: "))
4for i in range(1, n+1):
5 for j in range(1, i+1):
6 print('*', end='')
7 print()
1def StringPeriods (s):
2
3for i in range (int (len (s)/2), 0,-1):
4
5a = s[i] count = 2
6
7b = "
8
9while len (b)
10
11b = a * count
12
13if b == s:
14
15return a
16
17len(s):
18
19count += 1
20
21return -1