Need help in the problem: Christmas Spruce.

Revision en2, by absy, 2021-06-15 21:06:16

913B - Christmas Spruce

119557653

CODE:-

n= int(input()) ls=[] for i in range(n): ls.append([])

for i in range(2,n+1): j=int(input()) ls[j-1].append(i)

for i in ls: for j in i: if ls[j-1]: i.remove(j)

ls = list(filter(([]).__ne__, ls))

if len(min(ls))<3: print('No') else: print('Yes')

Tags #help, #newbie

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English absy 2021-06-16 11:46:39 343
en3 English absy 2021-06-15 21:23:42 695
en2 English absy 2021-06-15 21:06:16 5 Tiny change: 'blem:913B][submissio' -> 'blem:913B]\n\n[submissio'
en1 English absy 2021-06-15 21:05:33 421 Initial revision (published)