My solution to interview code test for Apple Search Engineering team.