You work as a clerk at a cinema box office and a new movie has been released. There are a lot of people standing in a line waiting to buy a ticket ...
For further actions, you may consider blocking this person and/or reporting abuse
Using JavaScript:
Scala
And the tests:
Rust:
Another JS approach
CondeSandbox
Python solution 🐍
using Ruby:
Haskell:
I think all my utility
add
andtake
kinda obscure the code a bit. Oh well. Also I'm flippingmakeChange
because I realized after thatfoldM
applies the arguments in the other order, and I was too lazy to rewrite :PTypescript: