Google Hash Code 2021
About Google Hash Code
Google Hash Code is a team programming competition, organized by Google, for students and professionals around the world. It allows you to share your skills and connect with other coders as you work together to solve a problem modeled off a real Google engineering challenge! In small teams of two to four, coders all over the world will tackle the first problem through Qualification Round. Though this round is hosted online, teams can come together virtually to compete side-by-side in locally coordinated Hash Code Hubs. The top teams from this round are invited to join us for the virtual World Finals.
The problem
Given the description of a city plan and planned paths for all cars in that city, optimize the schedule of traffic lights to minimize the total amount of time spent in traffic, and help as many cars as possible reach their destination before a given deadline.
For more details, please check the problem statement:
Our submission
The team was composed with @miquelt9, @alexland7219 and I, three friends studying Computer Science at Universitat Politècnica de Catalunya. At first, we tackled the problem by counting the potential number of cars that had to go through each traffic light and assigning greater slots of time to those that had more traffic. We were running out of time and compilation errors and several bugs were flourishing. At that time, @miquelt9 had a great idea to submit a solution where all traffic lights had the same duration. This was a simple solution, definitely worse than the first one, but it saved the day!
You can check both algorithms programs alongside the submission files in my Github repository.
In the end with our simple submission we obtained 7,886,739 points positioning ourselves in 4432 out of 9004. Not bad at all for our first ever coding competition.
You can check the full rankings here.