solutions to some algorithm problems