log in
About and Contact
© 2020 DOUBTCOOL
This questions look tricky, but its very simple
REMEMBER, you no need to use the full question for getting the output ,
Explaination :- In this question , they said that 'C' stores number of unique set of characters in the string.
For output the condition is given , if C less than 3 then print "Dynamic"
else print "Not"
Basically , you need to count the number of unique set of characters and check/compare with the conditions
Take a look at the python code for better understanding
** variable 't' in code is number of test case **
python code:-
t=int(input()) a=[] for i in range(t): s=str(input()) for j in s: if j not in a: a.append(s) if len(a)<3: print('Dynamic') else: print('Not')
t=int(input())
a=[]
for i in range(t):
s=str(input())
for j in s:
if j not in a:
a.append(s)
if len(a)<3:
print('Dynamic')
else:
print('Not')
t=int(input())
a=[]
for i in range(t):
s=str(input())
for j in s:
if j not in a:
a.append(s)
if len(a)<3:
print('Dynamic')
else:
print('Not')