3 comments

[ 2.7 ms ] story [ 20.1 ms ] thread
Hello !

I've been looking ath the HASHCODE 2018 competition and got interested on the problem proposition:

Task Given a list of pre-booked rides in a city and a fleet of self-driving vehicles, assign the rides to vehicles, so that riders get to their destinations on time.

For every ride that finishes on time (or early), you will earn points proportional to the distance of that ride; plus an additional bonus if the ride also started precisely on time.

It took me a while to get something working and at end I saw that I was basically using sqlite3 capabilities to do the data manipulation tasks and only needed a few calculations for the rest.

So I tried to see if I also could make those calculations inside sqlite3 and after a while I could get it to work:

https://github.com/mingodad/sqlite3-hashcode-2018/blob/maste...

As I stated there:

By no means I claim that solutions like this (stretching sqlite3) are good practice. Take it as an example that demonstrates several capabilities of sqlite3 in a hack/compact way.

So I'm showing it here just in case it can help/invite other people to find imaginative ways where sqlite3 can be used to solve problems.

Cheers !

Would this comment make a good source code comment?
In fact most of the referred comment come from the source code.

The main idea was to see how minimal a working solution could be achieved.