Deep Learning/Algorithm

백준 2941,1316

frances._.sb 2022. 3. 21. 12:59
728x90

 

 

#2941
word = input()
count = 0

croatian_alphabets = ["c=", "c-", "dz=","d-","lj","nj","s=","z="]
for alphabet in croatian_alphabets:
  word = word.replace(alphabet,"*")
print(len(word))

 

#1316
n = int(input())
cnt = n
for i in range(n):
  word = input()
  for j in range(len(word)-1):
    if word[j]==word[j+1]:
      pass
    elif word[j] in word[j+1:]:
      cnt-=1
      break
print(cnt)
728x90
반응형

'Deep Learning > Algorithm' 카테고리의 다른 글

백준 10250  (0) 2022.03.24
백준 2869  (0) 2022.03.23
백준 1193  (0) 2022.03.22
백준 1712, 2292  (0) 2022.03.21
백준 1152,2908,5622  (0) 2022.03.21