Apple interview question

A leet code question on Bucket sort on IPs.