A shady Internet business has been discovered.
The website has been made public by a whistle blower. We have enough evidence about the dirty deals they did. But to charge them we need to get hands on precise numbers about the transactions that happened on their platform.
Unfortunately no record of the transactions could be seized so far. The only hint we have is this one transaction:
fd0d929f-966f-4d1a-89cd-feee5a1c5347.json
What we need is the total of all transactions in Dollar. Can you trace down all other transactions and get the total?
Be careful to count each transaction only once, even if it is linked multiple times. You can use whatever tool works best for you.
Please share the total and your solution below!
Oldest comments (14)
You can have a look at some existing solutions over here.
Loving it!
I love whenever anybody posts challenges like this! Also, having the decimal separator be both
.
and,
was tricksy.SPOILER
$9064.79
My take:
In JavaScript:
My solution using goroutines for speed :)
P/s: Sorry for the ugly code :D It was written in a hurry
One possible way is to further optimize by let different "layers" of json object urls running "concurrently". Nevertheless, I haven't come up with an actual implementation (as you can see, right now my implementation only crawl one by one "layer" of gist urls)
Nice! I wrote a similar version but using a
sync.WaitGroup
and a separate constant number of workers to parallelize the download. You can find it here.Really had tons of fun solving it! Thanks for learning opportunity :D
Here's a Scala version, asynchronous, concurrent, non-blocking with async/await.
Using dispatch for requests and circe for json decoding.
My quick PHP solution