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.
defminimumBribes(q):# Write your code herebribes=0q=[0]+qfori,valinenumerate(q):ifval-i>2:print('Toochaotic')returnbribes+=sum([i>valforiinq[max(val-1,0):i]])print(bribes)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
New Year Chaos
You are viewing a single comment's thread. Return to all comments →
kudos to the author of this site https://csanim.com/tutorials/hackerrank-solution-new-year-chaos
realy help me with optimized solution