#K47192. Happy Word Classification
Happy Word Classification
Happy Word Classification
Given a word consisting of lowercase or uppercase characters, your task is to determine whether the word is "happy" or "sad". A word is considered happy if it contains at least one occurrence of two consecutive identical letters. Otherwise, the word is sad.
Note: The input word will have a length between 1 and 1000 characters.
For example, "bookkeeper" is happy because of the consecutive 'oo' and 'kk', while "unique" is sad as it doesn't contain any adjacent identical characters.
inputFormat
The input consists of a single line containing the word to be classified.
Example:
bookkeeper
outputFormat
Output a single line: "happy" if the word contains consecutive identical letters, or "sad" otherwise.
Example:
happy## sample
bookkeeper
happy