Skip to content

Baekjoon 10769

1. Problem

문제 확인하기

2. Solution (Python, memory: 31256KB, time: 40ms)

sentence, happy, sad = input(), 0, 0
for i in range(len(sentence)):
  if sentence[i] == ":":
    emoji = sentence[i:i+3]
    if emoji == ":-)":
      happy += 1
    elif emoji == ":-(":
      sad +=1

if happy > sad: print("happy")
elif happy < sad: print("sad")
else:
  if happy == sad == 0:
    print("none")
  else:
    print("unsure")