my solutions to some algorithm problems