Ram loves to solve problems and spend all his time either solving
problems or playing COC. One day while solving a problem, he
defined ‘Beautiful Strings’.
Given an alphanumeric string made up of digits and lower case
Latin characters only.
A string ‘s’ is called ‘Beautiful’ if and only if, it’s length is equal to
sum of all the digit characters in the string.
Sample Test case:
- Test Case 1: The length of string is 6 and digits in this string are
2 and 4. Hence, the sum of all of them is 6 which is equal to its
length therefore string is called ‘Beautiful’.
- Test Case 2: The length of string is 5 and digits in this string are
1 and 2. Hence, the sum of all of them is 3 which is not equal to
its length therefore string is called ‘Not Beautiful’.
t = int(input())
s = input()
ans = 0
for i in s:
ans += int(i)
if len(s) == ans: print("Beautiful") else: print("Not Beautiful") t -= 1