Optimizing Box Weights Hackerrank Solution For Sql