We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
importsysdeftoys(w):w=set(w)a=0whilelen(w)>0:z=min(w)a+=1w=list(filter(lambdax:x>z+4,w))returna# Complete this functionif__name__=="__main__":n=int(input().strip())w=list(map(int,input().strip().split(' ')))result=toys(w)print(result)
another way
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Priyanka and Toys
You are viewing a single comment's thread. Return to all comments →
another way