19 января 2025
def solve(s):
for i in range(1, len(s)):
s1, s2 = s[:i], s[i:]
if s1.count('a') == len(s1) and s2.count('b') == len(s2):
return True
return False
n=int(input())
ans=0
for _ in range(n):
s=input()
if solve(s):
ans+=1
print(ans)
#special string
#wipro
1.1K · n=int(input())
arr=[int(i) for i in input().split()]
p=[i for i in arr if i>0]
mid=len(p)//2
if mid%2==0:print(p[mid-1])
else:print(p[mid])
#positviemidindex
1.1K · print(sum(int(i) for i in input().split() if int(i)<0))
#sumofnegativenumbers
1.1K · x,y,z=map(int,input().split())
print(sum(sorted([x,y,z])[1:]))
#sum_of_maximum_two_numbers
1.1K · n=int(input())
arr=[int(i) for i in input().split()]
k=int(input())
print(*(arr[-k:]+arr[:-k]))
1K · Фотография
нажмите — покажем
нажмите — покажем
Фотография
нажмите — покажем
нажмите — покажем
Фотография
нажмите — покажем
нажмите — покажем