Simple algorithm code practice.