practice of simple algorithm problem