Hashcode 2018 — How to secure a global rank of 13 with just 100 simple lines of code and reach World Finals!

Shashwat Goel
1 min readNov 25, 2020

We (Nikhil Chandak and Shashwat Goel) decided to attempt Hashcode 2018 in a timed (4-hours) virtual environment, as just a team of 2 as our other teammates weren’t available. As the official checker wasn’t available as is in-contest, we decided to use the one by PicoJr on Github. We went in hoping to apply some of the discrete optimization techniques we’d recently picked up, specifically Mixed Integer Programming and Local Search. However, with just an easy to code, generalized and extremely intuitive greedy algorithm, we were able to rack up a score that would have us in the top-15 well within the time limit. This was surprising considering the simplicity of our approach, with no complication whatsoever. It all depended on one clever one-line selection function. Read on to find out more ;)

--

--