deftickets(queue)tillbox=[]can_process=truechange={25=>[],50=>[25],100=>[25,50]}queue.eachdo|bill|# if tillbox has the change requiredif(tillbox&change[bill]==change[bill])tillbox<<billchange[bill].each{|b|tillbox.delete_at(tillbox.index(b))}elsecan_process=falsebreakendendcan_processendputstickets([25,25,50,50])#trueputstickets([25,50,25,100])#false
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
using Ruby: