The Grid Search Hackerrank Solution In Python