solutions to various programming problems