solutions to online judges (uva, hacker-rank)