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!
Top comments (14)
Loving it!
My take:
In JavaScript:
I love whenever anybody posts challenges like this! Also, having the decimal separator be both
.
and,
was tricksy.SPOILER
$9064.79
My solution using goroutines for speed :)
P/s: Sorry for the ugly code :D It was written in a hurry
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.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)
My quick PHP solution
Here's a Scala version, asynchronous, concurrent, non-blocking with async/await.
Using dispatch for requests and circe for json decoding.
Hi! I think i solved it :) and it was very funny!
End of track: $146.091,89
The code is in my repo:
github.com/DiegoMGar/LearningChall...
Really had tons of fun solving it! Thanks for learning opportunity :D