Solution to TopCoder problems.